@perkyzz/emvb 0.1.0 → 0.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (153) hide show
  1. package/README.md +4 -2
  2. package/THIRD_PARTY_NOTICES.md +32 -0
  3. package/licenses/fontawesome-free.LICENSE +165 -0
  4. package/licenses/lucide-static.LICENSE +43 -0
  5. package/licenses/remixicon.LICENSE +201 -0
  6. package/licenses/tabler-icons.LICENSE +21 -0
  7. package/package.json +8 -4
  8. package/src/admin/api.ts +27 -0
  9. package/src/admin/content-api.ts +72 -9
  10. package/src/admin/editor/Editor.tsx +89 -14
  11. package/src/admin/editor/EditorOverlay.tsx +12 -0
  12. package/src/admin/editor/SmallScreenNotice.tsx +4 -3
  13. package/src/admin/editor/TopBar.tsx +76 -12
  14. package/src/admin/editor/canvas/CanvasFrame.tsx +224 -43
  15. package/src/admin/editor/canvas/DeviceBar.tsx +43 -2
  16. package/src/admin/editor/canvas/SelectionOverlay.tsx +60 -6
  17. package/src/admin/editor/canvas/canvas-events.ts +20 -7
  18. package/src/admin/editor/canvas/tab-reveal.ts +66 -0
  19. package/src/admin/editor/canvas/vnode-react.tsx +21 -1
  20. package/src/admin/editor/dialogs.tsx +39 -0
  21. package/src/admin/editor/dnd/drop-target.ts +63 -16
  22. package/src/admin/editor/dnd/new-element.ts +76 -1
  23. package/src/admin/editor/editor-css.ts +101 -15
  24. package/src/admin/editor/host.ts +30 -0
  25. package/src/admin/editor/icons/IconLibraryDialog.tsx +850 -0
  26. package/src/admin/editor/icons/library.ts +243 -0
  27. package/src/admin/editor/icons/set-format.ts +29 -0
  28. package/src/admin/editor/icons/sets/fontawesome.json +1 -0
  29. package/src/admin/editor/icons/sets/lucide.json +1 -0
  30. package/src/admin/editor/icons/sets/remix.json +1 -0
  31. package/src/admin/editor/icons/sets/tabler.json +1 -0
  32. package/src/admin/editor/panels/AddPanel.tsx +7 -3
  33. package/src/admin/editor/panels/ClassesSection.tsx +44 -6
  34. package/src/admin/editor/panels/ColorControl.tsx +268 -21
  35. package/src/admin/editor/panels/ElementPanel.tsx +237 -93
  36. package/src/admin/editor/panels/LayersPanel.tsx +303 -66
  37. package/src/admin/editor/panels/LeftPanel.tsx +4 -0
  38. package/src/admin/editor/panels/PageSettings.tsx +134 -5
  39. package/src/admin/editor/panels/SettingsPanel.tsx +12 -0
  40. package/src/admin/editor/panels/SiteStylesDrawer.tsx +158 -2
  41. package/src/admin/editor/panels/TriggersEditor.tsx +19 -2
  42. package/src/admin/editor/panels/VariableSection.tsx +47 -9
  43. package/src/admin/editor/panels/color-space.ts +195 -0
  44. package/src/admin/editor/panels/settings/AdvancedFields.tsx +119 -0
  45. package/src/admin/editor/panels/settings/BackgroundControls.tsx +153 -55
  46. package/src/admin/editor/panels/settings/BackgroundFill.tsx +221 -0
  47. package/src/admin/editor/panels/settings/BoxControl.tsx +271 -0
  48. package/src/admin/editor/panels/settings/ChoiceGroup.tsx +138 -0
  49. package/src/admin/editor/panels/settings/ClassChipInput.tsx +104 -2
  50. package/src/admin/editor/panels/settings/DraftTextField.tsx +44 -3
  51. package/src/admin/editor/panels/settings/EffectsControls.tsx +23 -16
  52. package/src/admin/editor/panels/settings/FieldBindControl.tsx +53 -17
  53. package/src/admin/editor/panels/settings/FieldControl.tsx +129 -9
  54. package/src/admin/editor/panels/settings/FormBindControl.tsx +14 -5
  55. package/src/admin/editor/panels/settings/IconControls.tsx +438 -0
  56. package/src/admin/editor/panels/settings/IconPicker.tsx +133 -72
  57. package/src/admin/editor/panels/settings/ItemList.tsx +199 -0
  58. package/src/admin/editor/panels/settings/LengthRow.tsx +97 -61
  59. package/src/admin/editor/panels/settings/LoopItemBindControl.tsx +10 -4
  60. package/src/admin/editor/panels/settings/MediaPicker.tsx +4 -2
  61. package/src/admin/editor/panels/settings/StateSwitcher.tsx +1 -1
  62. package/src/admin/editor/panels/settings/StyleRow.tsx +158 -75
  63. package/src/admin/editor/panels/settings/VariableBinding.tsx +5 -1
  64. package/src/admin/editor/panels/settings/advanced-rules.ts +63 -0
  65. package/src/admin/editor/panels/settings/background-mode.ts +112 -0
  66. package/src/admin/editor/panels/settings/box-link-name.ts +38 -0
  67. package/src/admin/editor/panels/settings/box-sides.ts +153 -0
  68. package/src/admin/editor/panels/settings/button-url.ts +27 -0
  69. package/src/admin/editor/panels/settings/class-suggest.ts +5 -3
  70. package/src/admin/editor/panels/settings/form-names.ts +38 -0
  71. package/src/admin/editor/panels/settings/heading-warning.ts +25 -0
  72. package/src/admin/editor/panels/settings/image-alt.ts +25 -0
  73. package/src/admin/editor/panels/settings/length-units.ts +40 -7
  74. package/src/admin/editor/panels/settings/loop-context.ts +26 -0
  75. package/src/admin/editor/panels/settings/style-sections.ts +114 -11
  76. package/src/admin/editor/panels/settings/svg-images.ts +14 -0
  77. package/src/admin/editor/panels/site-list.tsx +3 -0
  78. package/src/admin/editor/restore-deleted.ts +80 -0
  79. package/src/admin/editor/shortcuts.ts +1 -1
  80. package/src/admin/editor/store.ts +35 -7
  81. package/src/admin/editor/useEditorCommands.ts +66 -5
  82. package/src/admin/editor/useEditorData.ts +29 -3
  83. package/src/admin/editor/useEditorShortcuts.ts +34 -2
  84. package/src/admin/editor/useNodeActions.ts +68 -6
  85. package/src/admin/editor/useSave.ts +60 -3
  86. package/src/admin/entry-status.ts +19 -0
  87. package/src/admin/icon-uploads-api.ts +44 -0
  88. package/src/admin/pages/PageList.tsx +22 -2
  89. package/src/admin/pages/ThemePartList.tsx +23 -4
  90. package/src/admin/pages/list-kit.tsx +52 -2
  91. package/src/admin/setup/spec.ts +7 -0
  92. package/src/admin/theme-api.ts +61 -14
  93. package/src/admin/ui.ts +17 -4
  94. package/src/astro/EmVBPage.astro +28 -2
  95. package/src/astro/floats/EmVBFloatsRuntime.astro +9 -0
  96. package/src/astro/floats/index.ts +1 -0
  97. package/src/astro/floats/runtime.ts +78 -0
  98. package/src/astro/forms-definitions.ts +22 -0
  99. package/src/astro/index.ts +1 -0
  100. package/src/astro/menu/EmVBMenuRuntime.astro +9 -0
  101. package/src/astro/menu/index.ts +1 -0
  102. package/src/astro/menu/runtime.ts +37 -0
  103. package/src/astro/popups/runtime.ts +54 -4
  104. package/src/astro/render.ts +47 -13
  105. package/src/astro/resolve-theme.ts +164 -20
  106. package/src/astro/tabs/runtime.ts +6 -1
  107. package/src/astro/theme-context.ts +11 -3
  108. package/src/constants.ts +1 -1
  109. package/src/core/arrange.ts +98 -10
  110. package/src/core/clipboard.ts +91 -9
  111. package/src/core/css/generate.ts +21 -4
  112. package/src/core/design/classes.ts +95 -9
  113. package/src/core/design/transfer.ts +101 -2
  114. package/src/core/design/variables.ts +51 -11
  115. package/src/core/elements/dynamic-elements.ts +57 -5
  116. package/src/core/elements/field-id.ts +6 -0
  117. package/src/core/elements/form-elements.ts +23 -8
  118. package/src/core/elements/index.ts +267 -49
  119. package/src/core/elements/menu.ts +190 -0
  120. package/src/core/forms/definition.ts +11 -0
  121. package/src/core/index.ts +67 -3
  122. package/src/core/limits.ts +2 -0
  123. package/src/core/migrate/index.ts +51 -1
  124. package/src/core/nesting.ts +51 -0
  125. package/src/core/render/context.ts +7 -0
  126. package/src/core/render/dynamic-post.ts +39 -11
  127. package/src/core/render/extras.ts +22 -3
  128. package/src/core/render/form.ts +134 -36
  129. package/src/core/render/index.ts +123 -25
  130. package/src/core/render/loop.ts +10 -3
  131. package/src/core/render/pagination.ts +76 -0
  132. package/src/core/render/section.ts +5 -1
  133. package/src/core/render/tabs.ts +8 -4
  134. package/src/core/render/vnode.ts +1 -1
  135. package/src/core/sanitize/css.ts +197 -17
  136. package/src/core/sanitize/embed-url.ts +64 -7
  137. package/src/core/sanitize/svg-upload.ts +203 -0
  138. package/src/core/sanitize/svg.ts +102 -21
  139. package/src/core/schema/descriptors.ts +4 -0
  140. package/src/core/schema/design.ts +7 -2
  141. package/src/core/schema/layout.ts +210 -19
  142. package/src/core/schema/style.ts +87 -8
  143. package/src/core/tabs/presence.ts +9 -0
  144. package/src/core/theme/conditions.ts +4 -1
  145. package/src/core/theme/dynamic.ts +10 -0
  146. package/src/core/theme/float.ts +113 -0
  147. package/src/core/theme/pagination.ts +97 -0
  148. package/src/core/theme/part-types.ts +2 -0
  149. package/src/core/theme/popup-markup.ts +3 -1
  150. package/src/core/theme/popup-rules.ts +4 -3
  151. package/src/server/hooks.ts +20 -0
  152. package/src/server/icon-routes.ts +79 -0
  153. package/src/server/plugin.ts +5 -1
package/README.md CHANGED
@@ -1,5 +1,7 @@
1
1
  # @perkyzz/emvb
2
2
 
3
+ [![Website](https://img.shields.io/badge/website-emvb.dev-1f6feb)](https://emvb.dev) [![npm](https://img.shields.io/npm/v/@perkyzz/emvb)](https://www.npmjs.com/package/@perkyzz/emvb)
4
+
3
5
  A visual page builder plugin for [EmDash CMS](https://github.com/emdash-cms/emdash) 1.0.x. Pages are built in a full-screen editor inside the EmDash admin and published as plain HTML and CSS. It runs on Node (SQLite) and Cloudflare Workers (D1).
4
6
 
5
7
  ![The EmVB editor](https://raw.githubusercontent.com/PerkyZZ999/EmVB/main/site/public/screenshots/editor-1600.webp)
@@ -51,8 +53,8 @@ Without the forms plugin, leave out the `EmVBFormsRuntime` import and element; t
51
53
 
52
54
  Then sign in as an admin, open **Pages VisualBuilder** and click **Set up EmVB** once.
53
55
 
54
- The full guide, the demos and the source are on GitHub: <https://github.com/PerkyZZ999/EmVB>.
56
+ Website: <https://emvb.dev>. The full guide, the demos and the source are on GitHub: <https://github.com/PerkyZZ999/EmVB>.
55
57
 
56
58
  ## License
57
59
 
58
- MIT
60
+ MIT. The editor's Icon library includes Lucide (ISC), Font Awesome Free (icons CC BY 4.0, by Fonticons, Inc.), Tabler Icons (MIT) and Remix Icon 4.8.0 (Apache-2.0). Their notices and license texts are in [THIRD_PARTY_NOTICES.md](THIRD_PARTY_NOTICES.md) and `licenses/`. Icons you insert are saved into the page as SVG; a site that uses Font Awesome icons should credit Font Awesome (CC BY 4.0), for example "Icons by Font Awesome (fontawesome.com), CC BY 4.0" in its footer or credits.
@@ -0,0 +1,32 @@
1
+ # Third-party notices
2
+
3
+ EmVB (<https://emvb.dev>) is MIT licensed. The editor's **Icon library** (`src/admin/editor/icons/sets/*.json`) contains icons from the projects below. They keep their own licenses, copied in full in [`licenses/`](licenses/). `scripts/build-icon-sets.ts` in the EmVB repository builds the set files from the pinned npm packages. It refuses to build when a package's license file changes.
4
+
5
+ Changes made to every set: the SVG markup is reformatted into compact JSON, and only elements and attributes in EmVB's SVG allowlist are kept. Class attributes and comments are removed. Shared presentation attributes (stroke or fill, viewBox) move to the root `<svg>`. Set-specific changes are listed with each set.
6
+
7
+ When an editor picks an icon, its SVG is stored with the page and shown inline on the public site. No icon library is loaded there.
8
+
9
+ ## Lucide
10
+
11
+ - Package: `lucide-static` 1.52.0, <https://lucide.dev>
12
+ - License: ISC, Copyright (c) 2026 Lucide Icons and Contributors. Icons derived from Feather: MIT, Copyright (c) 2013-present Cole Bemis. Full text: [`licenses/lucide-static.LICENSE`](licenses/lucide-static.LICENSE).
13
+ - The 26 icons EmVB bundled before the library (`src/core/icons/catalog.ts`) are also Lucide icons, under the same license.
14
+
15
+ ## Font Awesome Free
16
+
17
+ - Package: `@fortawesome/fontawesome-free` 7.3.1, <https://fontawesome.com>
18
+ - Icons: Font Awesome Free by Fonticons, Inc., licensed under [CC BY 4.0](https://creativecommons.org/licenses/by/4.0/). Full text: [`licenses/fontawesome-free.LICENSE`](licenses/fontawesome-free.LICENSE).
19
+ - Changes: the attribution comment in each SVG file is removed by EmVB's sanitizer, so this notice carries the attribution. Each path's `fill="currentColor"` moves to the root `<svg>`.
20
+ - Brand icons are trademarks of their owners. Use them only to represent the company, product or service they refer to.
21
+
22
+ ## Tabler Icons
23
+
24
+ - Package: `@tabler/icons` 3.49.0, <https://tabler.io/icons>
25
+ - License: MIT, Copyright (c) 2020-2026 Paweł Kuna. Full text: [`licenses/tabler-icons.LICENSE`](licenses/tabler-icons.LICENSE).
26
+ - Changes: the invisible 24×24 bounding path (`M0 0h24v24H0z`) is left out.
27
+
28
+ ## Remix Icon
29
+
30
+ - Package: `remixicon` 4.8.0, <https://remixicon.com>. 4.8.0 is the last release under Apache-2.0; 4.9.0 moved to the custom "Remix Icon License v1.0", which forbids competing icon libraries, so EmVB stays on 4.8.0.
31
+ - License: Apache License 2.0, Copyright (c) Remix Design. Full text: [`licenses/remixicon.LICENSE`](licenses/remixicon.LICENSE).
32
+ - Changes (Apache-2.0 §4(b)): path coordinates are rounded to two decimals. All Remix paths use absolute commands, so the error stays under 0.005 units on the 24-unit grid. The icon files are not otherwise modified.
@@ -0,0 +1,165 @@
1
+ Fonticons, Inc. (https://fontawesome.com)
2
+
3
+ --------------------------------------------------------------------------------
4
+
5
+ Font Awesome Free License
6
+
7
+ Font Awesome Free is free, open source, and GPL friendly. You can use it for
8
+ commercial projects, open source projects, or really almost whatever you want.
9
+ Full Font Awesome Free license: https://fontawesome.com/license/free.
10
+
11
+ --------------------------------------------------------------------------------
12
+
13
+ # Icons: CC BY 4.0 License (https://creativecommons.org/licenses/by/4.0/)
14
+
15
+ The Font Awesome Free download is licensed under a Creative Commons
16
+ Attribution 4.0 International License and applies to all icons packaged
17
+ as SVG and JS file types.
18
+
19
+ --------------------------------------------------------------------------------
20
+
21
+ # Fonts: SIL OFL 1.1 License
22
+
23
+ In the Font Awesome Free download, the SIL OFL license applies to all icons
24
+ packaged as web and desktop font files.
25
+
26
+ Copyright (c) 2026 Fonticons, Inc. (https://fontawesome.com)
27
+ with Reserved Font Name: "Font Awesome".
28
+
29
+ This Font Software is licensed under the SIL Open Font License, Version 1.1.
30
+ This license is copied below, and is also available with a FAQ at:
31
+ http://scripts.sil.org/OFL
32
+
33
+ SIL OPEN FONT LICENSE
34
+ Version 1.1 - 26 February 2007
35
+
36
+ PREAMBLE
37
+ The goals of the Open Font License (OFL) are to stimulate worldwide
38
+ development of collaborative font projects, to support the font creation
39
+ efforts of academic and linguistic communities, and to provide a free and
40
+ open framework in which fonts may be shared and improved in partnership
41
+ with others.
42
+
43
+ The OFL allows the licensed fonts to be used, studied, modified and
44
+ redistributed freely as long as they are not sold by themselves. The
45
+ fonts, including any derivative works, can be bundled, embedded,
46
+ redistributed and/or sold with any software provided that any reserved
47
+ names are not used by derivative works. The fonts and derivatives,
48
+ however, cannot be released under any other type of license. The
49
+ requirement for fonts to remain under this license does not apply
50
+ to any document created using the fonts or their derivatives.
51
+
52
+ DEFINITIONS
53
+ "Font Software" refers to the set of files released by the Copyright
54
+ Holder(s) under this license and clearly marked as such. This may
55
+ include source files, build scripts and documentation.
56
+
57
+ "Reserved Font Name" refers to any names specified as such after the
58
+ copyright statement(s).
59
+
60
+ "Original Version" refers to the collection of Font Software components as
61
+ distributed by the Copyright Holder(s).
62
+
63
+ "Modified Version" refers to any derivative made by adding to, deleting,
64
+ or substituting — in part or in whole — any of the components of the
65
+ Original Version, by changing formats or by porting the Font Software to a
66
+ new environment.
67
+
68
+ "Author" refers to any designer, engineer, programmer, technical
69
+ writer or other person who contributed to the Font Software.
70
+
71
+ PERMISSION & CONDITIONS
72
+ Permission is hereby granted, free of charge, to any person obtaining
73
+ a copy of the Font Software, to use, study, copy, merge, embed, modify,
74
+ redistribute, and sell modified and unmodified copies of the Font
75
+ Software, subject to the following conditions:
76
+
77
+ 1) Neither the Font Software nor any of its individual components,
78
+ in Original or Modified Versions, may be sold by itself.
79
+
80
+ 2) Original or Modified Versions of the Font Software may be bundled,
81
+ redistributed and/or sold with any software, provided that each copy
82
+ contains the above copyright notice and this license. These can be
83
+ included either as stand-alone text files, human-readable headers or
84
+ in the appropriate machine-readable metadata fields within text or
85
+ binary files as long as those fields can be easily viewed by the user.
86
+
87
+ 3) No Modified Version of the Font Software may use the Reserved Font
88
+ Name(s) unless explicit written permission is granted by the corresponding
89
+ Copyright Holder. This restriction only applies to the primary font name as
90
+ presented to the users.
91
+
92
+ 4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font
93
+ Software shall not be used to promote, endorse or advertise any
94
+ Modified Version, except to acknowledge the contribution(s) of the
95
+ Copyright Holder(s) and the Author(s) or with their explicit written
96
+ permission.
97
+
98
+ 5) The Font Software, modified or unmodified, in part or in whole,
99
+ must be distributed entirely under this license, and must not be
100
+ distributed under any other license. The requirement for fonts to
101
+ remain under this license does not apply to any document created
102
+ using the Font Software.
103
+
104
+ TERMINATION
105
+ This license becomes null and void if any of the above conditions are
106
+ not met.
107
+
108
+ DISCLAIMER
109
+ THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
110
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF
111
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
112
+ OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE
113
+ COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
114
+ INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL
115
+ DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
116
+ FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM
117
+ OTHER DEALINGS IN THE FONT SOFTWARE.
118
+
119
+ --------------------------------------------------------------------------------
120
+
121
+ # Code: MIT License (https://opensource.org/licenses/MIT)
122
+
123
+ In the Font Awesome Free download, the MIT license applies to all non-font and
124
+ non-icon files.
125
+
126
+ Copyright 2026 Fonticons, Inc.
127
+
128
+ Permission is hereby granted, free of charge, to any person obtaining a copy of
129
+ this software and associated documentation files (the "Software"), to deal in the
130
+ Software without restriction, including without limitation the rights to use, copy,
131
+ modify, merge, publish, distribute, sublicense, and/or sell copies of the Software,
132
+ and to permit persons to whom the Software is furnished to do so, subject to the
133
+ following conditions:
134
+
135
+ The above copyright notice and this permission notice shall be included in all
136
+ copies or substantial portions of the Software.
137
+
138
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
139
+ INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
140
+ PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
141
+ HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
142
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
143
+ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
144
+
145
+ --------------------------------------------------------------------------------
146
+
147
+ # Attribution
148
+
149
+ Attribution is required by MIT, SIL OFL, and CC BY licenses. Downloaded Font
150
+ Awesome Free files already contain embedded comments with sufficient
151
+ attribution, so you shouldn't need to do anything additional when using these
152
+ files normally.
153
+
154
+ We've kept attribution comments terse, so we ask that you do not actively work
155
+ to remove them from files, especially code. They're a great way for folks to
156
+ learn about Font Awesome.
157
+
158
+ --------------------------------------------------------------------------------
159
+
160
+ # Brand Icons
161
+
162
+ All brand icons are trademarks of their respective owners. The use of these
163
+ trademarks does not indicate endorsement of the trademark holder by Font
164
+ Awesome, nor vice versa. **Please do not use brand logos for any purpose except
165
+ to represent the company, product, or service to which they refer.**
@@ -0,0 +1,43 @@
1
+ ISC License
2
+
3
+ Copyright (c) 2026 Lucide Icons and Contributors
4
+
5
+ Permission to use, copy, modify, and/or distribute this software for any
6
+ purpose with or without fee is hereby granted, provided that the above
7
+ copyright notice and this permission notice appear in all copies.
8
+
9
+ THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
10
+ WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
11
+ MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
12
+ ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
13
+ WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
14
+ ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
15
+ OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
16
+
17
+ ---
18
+
19
+ The following Lucide icons are derived from the Feather project:
20
+
21
+ airplay, alert-circle, alert-octagon, alert-triangle, aperture, arrow-down-circle, arrow-down-left, arrow-down-right, arrow-down, arrow-left-circle, arrow-left, arrow-right-circle, arrow-right, arrow-up-circle, arrow-up-left, arrow-up-right, arrow-up, at-sign, calendar, cast, check, chevron-down, chevron-left, chevron-right, chevron-up, chevrons-down, chevrons-left, chevrons-right, chevrons-up, circle, clipboard, clock, code, columns, command, compass, corner-down-left, corner-down-right, corner-left-down, corner-left-up, corner-right-down, corner-right-up, corner-up-left, corner-up-right, crosshair, database, divide-circle, divide-square, dollar-sign, download, external-link, feather, frown, hash, headphones, help-circle, info, italic, key, layout, life-buoy, link-2, link, loader, lock, log-in, log-out, maximize, meh, minimize, minimize-2, minus-circle, minus-square, minus, monitor, moon, more-horizontal, more-vertical, move, music, navigation-2, navigation, octagon, pause-circle, percent, plus-circle, plus-square, plus, power, radio, rss, search, server, share, shopping-bag, sidebar, smartphone, smile, square, table-2, tablet, target, terminal, trash-2, trash, triangle, tv, type, upload, x-circle, x-octagon, x-square, x, zoom-in, zoom-out
22
+
23
+ The MIT License (MIT) (for the icons listed above)
24
+
25
+ Copyright (c) 2013-present Cole Bemis
26
+
27
+ Permission is hereby granted, free of charge, to any person obtaining a copy
28
+ of this software and associated documentation files (the "Software"), to deal
29
+ in the Software without restriction, including without limitation the rights
30
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
31
+ copies of the Software, and to permit persons to whom the Software is
32
+ furnished to do so, subject to the following conditions:
33
+
34
+ The above copyright notice and this permission notice shall be included in all
35
+ copies or substantial portions of the Software.
36
+
37
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
38
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
39
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
40
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
41
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
42
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
43
+ SOFTWARE.
@@ -0,0 +1,201 @@
1
+ Apache License
2
+ Version 2.0, January 2004
3
+ http://www.apache.org/licenses/
4
+
5
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
6
+
7
+ 1. Definitions.
8
+
9
+ "License" shall mean the terms and conditions for use, reproduction,
10
+ and distribution as defined by Sections 1 through 9 of this document.
11
+
12
+ "Licensor" shall mean the copyright owner or entity authorized by
13
+ the copyright owner that is granting the License.
14
+
15
+ "Legal Entity" shall mean the union of the acting entity and all
16
+ other entities that control, are controlled by, or are under common
17
+ control with that entity. For the purposes of this definition,
18
+ "control" means (i) the power, direct or indirect, to cause the
19
+ direction or management of such entity, whether by contract or
20
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
21
+ outstanding shares, or (iii) beneficial ownership of such entity.
22
+
23
+ "You" (or "Your") shall mean an individual or Legal Entity
24
+ exercising permissions granted by this License.
25
+
26
+ "Source" form shall mean the preferred form for making modifications,
27
+ including but not limited to software source code, documentation
28
+ source, and configuration files.
29
+
30
+ "Object" form shall mean any form resulting from mechanical
31
+ transformation or translation of a Source form, including but
32
+ not limited to compiled object code, generated documentation,
33
+ and conversions to other media types.
34
+
35
+ "Work" shall mean the work of authorship, whether in Source or
36
+ Object form, made available under the License, as indicated by a
37
+ copyright notice that is included in or attached to the work
38
+ (an example is provided in the Appendix below).
39
+
40
+ "Derivative Works" shall mean any work, whether in Source or Object
41
+ form, that is based on (or derived from) the Work and for which the
42
+ editorial revisions, annotations, elaborations, or other modifications
43
+ represent, as a whole, an original work of authorship. For the purposes
44
+ of this License, Derivative Works shall not include works that remain
45
+ separable from, or merely link (or bind by name) to the interfaces of,
46
+ the Work and Derivative Works thereof.
47
+
48
+ "Contribution" shall mean any work of authorship, including
49
+ the original version of the Work and any modifications or additions
50
+ to that Work or Derivative Works thereof, that is intentionally
51
+ submitted to Licensor for inclusion in the Work by the copyright owner
52
+ or by an individual or Legal Entity authorized to submit on behalf of
53
+ the copyright owner. For the purposes of this definition, "submitted"
54
+ means any form of electronic, verbal, or written communication sent
55
+ to the Licensor or its representatives, including but not limited to
56
+ communication on electronic mailing lists, source code control systems,
57
+ and issue tracking systems that are managed by, or on behalf of, the
58
+ Licensor for the purpose of discussing and improving the Work, but
59
+ excluding communication that is conspicuously marked or otherwise
60
+ designated in writing by the copyright owner as "Not a Contribution."
61
+
62
+ "Contributor" shall mean Licensor and any individual or Legal Entity
63
+ on behalf of whom a Contribution has been received by Licensor and
64
+ subsequently incorporated within the Work.
65
+
66
+ 2. Grant of Copyright License. Subject to the terms and conditions of
67
+ this License, each Contributor hereby grants to You a perpetual,
68
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
69
+ copyright license to reproduce, prepare Derivative Works of,
70
+ publicly display, publicly perform, sublicense, and distribute the
71
+ Work and such Derivative Works in Source or Object form.
72
+
73
+ 3. Grant of Patent License. Subject to the terms and conditions of
74
+ this License, each Contributor hereby grants to You a perpetual,
75
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
76
+ (except as stated in this section) patent license to make, have made,
77
+ use, offer to sell, sell, import, and otherwise transfer the Work,
78
+ where such license applies only to those patent claims licensable
79
+ by such Contributor that are necessarily infringed by their
80
+ Contribution(s) alone or by combination of their Contribution(s)
81
+ with the Work to which such Contribution(s) was submitted. If You
82
+ institute patent litigation against any entity (including a
83
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
84
+ or a Contribution incorporated within the Work constitutes direct
85
+ or contributory patent infringement, then any patent licenses
86
+ granted to You under this License for that Work shall terminate
87
+ as of the date such litigation is filed.
88
+
89
+ 4. Redistribution. You may reproduce and distribute copies of the
90
+ Work or Derivative Works thereof in any medium, with or without
91
+ modifications, and in Source or Object form, provided that You
92
+ meet the following conditions:
93
+
94
+ (a) You must give any other recipients of the Work or
95
+ Derivative Works a copy of this License; and
96
+
97
+ (b) You must cause any modified files to carry prominent notices
98
+ stating that You changed the files; and
99
+
100
+ (c) You must retain, in the Source form of any Derivative Works
101
+ that You distribute, all copyright, patent, trademark, and
102
+ attribution notices from the Source form of the Work,
103
+ excluding those notices that do not pertain to any part of
104
+ the Derivative Works; and
105
+
106
+ (d) If the Work includes a "NOTICE" text file as part of its
107
+ distribution, then any Derivative Works that You distribute must
108
+ include a readable copy of the attribution notices contained
109
+ within such NOTICE file, excluding those notices that do not
110
+ pertain to any part of the Derivative Works, in at least one
111
+ of the following places: within a NOTICE text file distributed
112
+ as part of the Derivative Works; within the Source form or
113
+ documentation, if provided along with the Derivative Works; or,
114
+ within a display generated by the Derivative Works, if and
115
+ wherever such third-party notices normally appear. The contents
116
+ of the NOTICE file are for informational purposes only and
117
+ do not modify the License. You may add Your own attribution
118
+ notices within Derivative Works that You distribute, alongside
119
+ or as an addendum to the NOTICE text from the Work, provided
120
+ that such additional attribution notices cannot be construed
121
+ as modifying the License.
122
+
123
+ You may add Your own copyright statement to Your modifications and
124
+ may provide additional or different license terms and conditions
125
+ for use, reproduction, or distribution of Your modifications, or
126
+ for any such Derivative Works as a whole, provided Your use,
127
+ reproduction, and distribution of the Work otherwise complies with
128
+ the conditions stated in this License.
129
+
130
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
131
+ any Contribution intentionally submitted for inclusion in the Work
132
+ by You to the Licensor shall be under the terms and conditions of
133
+ this License, without any additional terms or conditions.
134
+ Notwithstanding the above, nothing herein shall supersede or modify
135
+ the terms of any separate license agreement you may have executed
136
+ with Licensor regarding such Contributions.
137
+
138
+ 6. Trademarks. This License does not grant permission to use the trade
139
+ names, trademarks, service marks, or product names of the Licensor,
140
+ except as required for reasonable and customary use in describing the
141
+ origin of the Work and reproducing the content of the NOTICE file.
142
+
143
+ 7. Disclaimer of Warranty. Unless required by applicable law or
144
+ agreed to in writing, Licensor provides the Work (and each
145
+ Contributor provides its Contributions) on an "AS IS" BASIS,
146
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
147
+ implied, including, without limitation, any warranties or conditions
148
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
149
+ PARTICULAR PURPOSE. You are solely responsible for determining the
150
+ appropriateness of using or redistributing the Work and assume any
151
+ risks associated with Your exercise of permissions under this License.
152
+
153
+ 8. Limitation of Liability. In no event and under no legal theory,
154
+ whether in tort (including negligence), contract, or otherwise,
155
+ unless required by applicable law (such as deliberate and grossly
156
+ negligent acts) or agreed to in writing, shall any Contributor be
157
+ liable to You for damages, including any direct, indirect, special,
158
+ incidental, or consequential damages of any character arising as a
159
+ result of this License or out of the use or inability to use the
160
+ Work (including but not limited to damages for loss of goodwill,
161
+ work stoppage, computer failure or malfunction, or any and all
162
+ other commercial damages or losses), even if such Contributor
163
+ has been advised of the possibility of such damages.
164
+
165
+ 9. Accepting Warranty or Additional Liability. While redistributing
166
+ the Work or Derivative Works thereof, You may choose to offer,
167
+ and charge a fee for, acceptance of support, warranty, indemnity,
168
+ or other liability obligations and/or rights consistent with this
169
+ License. However, in accepting such obligations, You may act only
170
+ on Your own behalf and on Your sole responsibility, not on behalf
171
+ of any other Contributor, and only if You agree to indemnify,
172
+ defend, and hold each Contributor harmless for any liability
173
+ incurred by, or claims asserted against, such Contributor by reason
174
+ of your accepting any such warranty or additional liability.
175
+
176
+ END OF TERMS AND CONDITIONS
177
+
178
+ APPENDIX: How to apply the Apache License to your work.
179
+
180
+ To apply the Apache License to your work, attach the following
181
+ boilerplate notice, with the fields enclosed by brackets "[]"
182
+ replaced with your own identifying information. (Don't include
183
+ the brackets!) The text should be enclosed in the appropriate
184
+ comment syntax for the file format. We also recommend that a
185
+ file or class name and description of purpose be included on the
186
+ same "printed page" as the copyright notice for easier
187
+ identification within third-party archives.
188
+
189
+ Copyright [yyyy] [name of copyright owner]
190
+
191
+ Licensed under the Apache License, Version 2.0 (the "License");
192
+ you may not use this file except in compliance with the License.
193
+ You may obtain a copy of the License at
194
+
195
+ http://www.apache.org/licenses/LICENSE-2.0
196
+
197
+ Unless required by applicable law or agreed to in writing, software
198
+ distributed under the License is distributed on an "AS IS" BASIS,
199
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
200
+ See the License for the specific language governing permissions and
201
+ limitations under the License.
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2020-2026 Paweł Kuna
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@perkyzz/emvb",
3
- "version": "0.1.0",
3
+ "version": "0.2.0",
4
4
  "description": "Visual page builder plugin for EmDash CMS",
5
5
  "keywords": [
6
6
  "astro",
@@ -10,7 +10,7 @@
10
10
  "page-builder",
11
11
  "visual-editor"
12
12
  ],
13
- "homepage": "https://github.com/PerkyZZ999/EmVB#readme",
13
+ "homepage": "https://emvb.dev",
14
14
  "bugs": {
15
15
  "url": "https://github.com/PerkyZZ999/EmVB/issues"
16
16
  },
@@ -24,7 +24,9 @@
24
24
  "src",
25
25
  "!src/**/*.test.ts",
26
26
  "!src/**/*.test.tsx",
27
- "!src/**/__snapshots__"
27
+ "!src/**/__snapshots__",
28
+ "THIRD_PARTY_NOTICES.md",
29
+ "licenses"
28
30
  ],
29
31
  "type": "module",
30
32
  "exports": {
@@ -34,7 +36,9 @@
34
36
  "./astro": "./src/astro/index.ts",
35
37
  "./astro/forms": "./src/astro/forms/index.ts",
36
38
  "./astro/popups": "./src/astro/popups/index.ts",
37
- "./astro/tabs": "./src/astro/tabs/index.ts"
39
+ "./astro/floats": "./src/astro/floats/index.ts",
40
+ "./astro/tabs": "./src/astro/tabs/index.ts",
41
+ "./astro/menu": "./src/astro/menu/index.ts"
38
42
  },
39
43
  "publishConfig": {
40
44
  "access": "public"
package/src/admin/api.ts CHANGED
@@ -46,3 +46,30 @@ export async function requestJson<T>(
46
46
  if (!response.ok) throw envelopeError(response, payload);
47
47
  return payload.data as T;
48
48
  }
49
+
50
+ const LIST_PAGE = 50;
51
+ /** Enough for any real site (1000 entries); stops a cursor that never ends. */
52
+ const LIST_MAX_PAGES = 20;
53
+
54
+ /**
55
+ * Every entry of a content list, newest first, page by page (W-204): one request used to stop at
56
+ * the 50 most recently updated, so older pages and parts never showed in the lists.
57
+ */
58
+ export async function listAllItems<T>(fetcher: Fetcher, collectionPath: string): Promise<T[]> {
59
+ const items: T[] = [];
60
+ let cursor: string | undefined;
61
+ for (let page = 0; page < LIST_MAX_PAGES; page += 1) {
62
+ const query = `?limit=${LIST_PAGE}&orderBy=updatedAt&order=desc${
63
+ cursor ? `&cursor=${encodeURIComponent(cursor)}` : ""
64
+ }`;
65
+ // oxlint-disable-next-line no-await-in-loop -- each page needs the previous page's cursor
66
+ const body = await requestJson<{ items?: T[]; nextCursor?: string }>(
67
+ fetcher,
68
+ `${collectionPath}${query}`,
69
+ );
70
+ items.push(...(body?.items ?? []));
71
+ cursor = body?.nextCursor || undefined;
72
+ if (!cursor) break;
73
+ }
74
+ return items;
75
+ }