-
-
Notifications
You must be signed in to change notification settings - Fork 7
Added ... Copy/Paste of Blocks, Collapsible Sections, Shared Field Includes, Recent Blocks #67
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Closed
Closed
Changes from all commits
Commits
Show all changes
44 commits
Select commit
Hold shift + click to select a range
ebe6e01
Add collapsible sections shorthand and tabs support
helmutkaufmann 4b1afdd
Add collapsible sections and tabs documentation
helmutkaufmann 4d755b8
Minor README wording cleanup
helmutkaufmann 648eb9a
Fix repeater stall inside manually-uncollapsed sections
helmutkaufmann c292d65
Fix section re-collapse flicker on repeater AJAX using MutationObserver
helmutkaufmann 448537f
Fix collapsible section re-collapse by shielding during AJAX
helmutkaufmann f109fe8
Fully own collapsible sections to fix repeater stall
helmutkaufmann b2fe297
Use MutationObserver for collapsible section init
helmutkaufmann 0a29d9b
Place collapsible.js in the widget's actual asset path
helmutkaufmann 75e3ee0
Inline collapsible-sections bootstrap in block widget partial
helmutkaufmann 0982f31
Remove unused collapsible.js; inline bootstrap is canonical
helmutkaufmann ca958bd
Stop tracking .DS_Store files
helmutkaufmann 2d8f1e6
Add shared field includes for block definitions
helmutkaufmann 03871e7
Add nested includes, schema guard, collapse persistence, recent blocks
helmutkaufmann 60443ed
Add tests for includes and collapsible shorthand
helmutkaufmann c1b394b
Remove fork references from README and CHANGELOG
helmutkaufmann 4830cc0
Tidy winter.mix.js comment about the two blocks.js files
helmutkaufmann 742dacc
Add copy/cut/paste for blocks
helmutkaufmann dc990d4
Improve copy/cut/paste UX: inline paste button per block
helmutkaufmann bdf8693
Add paste-to-empty-widget support via add-item row
helmutkaufmann 82854eb
Fix paste detection (smart quotes) and toolbar alignment
helmutkaufmann 216d04c
Make paste link fail open and render reliably
helmutkaufmann 6a3dd57
Move "Paste block" onto its own list row so it is never clipped
helmutkaufmann e097de7
Drive paste from explicit data attributes, not template parsing
helmutkaufmann a10264d
Consolidate item controls into one non-overflowing toolbar
helmutkaufmann 3f5975d
Fix toolbar overflow with !important; move paste into Add-Item palette
helmutkaufmann d10d728
Add Copy button; stop "Add new item" rows accumulating
helmutkaufmann 1363950
Fix palette "Paste block" by clicking the real add link
helmutkaufmann 83c08e9
Fix palette paste: fire request on the link instead of synthetic click
helmutkaufmann e70c80a
Fix copy/paste: resolve infinite MutationObserver loop and show paste…
helmutkaufmann dbfe9a5
Replace search-bar paste button with grid pseudo-block entry
helmutkaufmann b6937e6
docs: clarify Duplicate vs Paste after in README
helmutkaufmann 451dcb5
chore: bump version to 1.1.0
helmutkaufmann 6576a94
Clean up custom code from review pass
helmutkaufmann a5208e9
Remove Duplicate vs Paste table from README
helmutkaufmann 71d2c23
Add git clone instructions for the fork
helmutkaufmann b77a62f
Add update instructions for the fork
helmutkaufmann f0a95ac
Add yaml language hint to Fields and Configuration example
helmutkaufmann 1e87f22
Auto-refresh richeditor and codeeditor widgets after paste fill
helmutkaufmann abb9db4
Reduce MutationObserver overhead for large block lists
helmutkaufmann 05794db
Document field-key collision limitation in paste/duplicate note
helmutkaufmann e3b45d3
Updated compsoer.json
helmutkaufmann 750033d
Updated compsoer.json
helmutkaufmann d2c385a
Remove tab/secondaryTabs support — feature was never rendered
helmutkaufmann File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,2 +1,3 @@ | ||
| .phpunit.result.cache | ||
| mix.webpack.js | ||
| .DS_Store |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,52 @@ | ||
| # Changelog | ||
|
|
||
| ## Unreleased | ||
|
|
||
| ### Collapsible sections | ||
| - `.block` `type: section` fields support a `collapsible: true` shorthand, with | ||
| `collapsed: true|false` controlling the initial state. | ||
| - Handled via the `data-block-collapsible` attribute and an inline bootstrap in | ||
| the block widget partial, independent of core's collapsible-section JS. This | ||
| fixes the core behaviour where adding an item to a repeater nested inside a | ||
| section re-collapsed it and double-bound its click handler (causing the | ||
| "Add item" stall). | ||
| - **Open/closed state now persists** per section across page reloads | ||
| (`localStorage`, keyed by field name). | ||
|
|
||
| ### Shared field includes | ||
| - `.block` definitions may declare a top-level `include:` (string or list) to | ||
| merge `fields` and `config` from external plain-YAML files. | ||
| - Included definitions form the base; the block's own definitions override on | ||
| collision. Paths resolve via `File::symbolizePath()` (`$/`, `~/`, `#/`). | ||
| - **Nested includes** are resolved recursively, guarded against circular | ||
| references. | ||
| - A **schema guard** logs a warning when an include would redefine a field with | ||
| a different `type`. | ||
| - Missing include files are skipped and logged as a warning. | ||
|
|
||
| ### Editor UX | ||
| - **Recently used blocks** are pinned to the top of the "add block" palette | ||
| (tracked in `localStorage`, most-recent first). | ||
| - **Copy / Cut / Paste / Duplicate blocks** — each block has one horizontal | ||
| toolbar (collapse, copy, cut, paste, duplicate, config, delete). Copy/cut/ | ||
| duplicate place the block's field values on the clipboard (`sessionStorage`); | ||
| paste inserts after a block, or appends via a "Paste block" entry at the top | ||
| of the *+ Add New Item* palette (for empty widgets). Duplicate also clones in | ||
| place. Paste affordances appear only where the copied block type is offered | ||
| (respects `allow`/`ignore`/`tags`) and survive navigation within the same | ||
| browser tab. Direct add/paste/duplicate requests run the same empty-add-item | ||
| cleanup as the core popover flow, so "Add new item" rows no longer pile up. | ||
|
|
||
| ### Tests | ||
| - `BlockManagerTest`: include merging, block-overrides-include precedence, | ||
| nested includes, circular-include guard, missing-file skip, multiple includes, | ||
| and the no-include no-op. | ||
| - `BlocksTest`: `collapsible`/`collapsed` shorthand translation to | ||
| `data-block-collapsible` / `data-block-collapsible-open`, and that non-section | ||
| / plain-section fields are left untouched. | ||
| - Fixtures under `tests/fixtures/blocks/includes/`. | ||
|
|
||
| ### Housekeeping | ||
| - Documented the two distinct `blocks.js` files (frontend Snowboard build vs. | ||
| backend FormWidget script) in `winter.mix.js` to prevent accidental merging. | ||
| - Stopped tracking `.DS_Store` files. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fix include-order precedence across multiple includes.
The current loop reuses progressively merged
$config[$key]as$own, so earlier include values are treated like block-owned values on later iterations. In collision cases, this makes earlier includes win over later ones.Suggested fix (preserve: later include overrides earlier include; block overrides all includes)
📝 Committable suggestion
🤖 Prompt for AI Agents