@blokkli/editor 2.0.0-alpha.2 → 2.0.0-alpha.21
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.
- package/dist/module.d.mts +1 -1
- package/dist/module.json +5 -5
- package/dist/module.mjs +5549 -1269
- package/dist/modules/drupal/graphql/base/fragment.ParagraphsBlokkliConfigInput.graphql +31 -0
- package/dist/modules/drupal/graphql/base/fragment.blokkliProps.graphql +9 -0
- package/dist/modules/drupal/graphql/base/fragment.paragraphsBlokkliEditState.graphql +5 -0
- package/dist/modules/drupal/graphql/base/fragment.paragraphsFieldItem.graphql +9 -0
- package/dist/modules/drupal/graphql/base/query.pbConfig.graphql +1 -10
- package/dist/modules/drupal/graphql/base/query.pbEntityConfig.graphql +5 -0
- package/dist/modules/drupal/graphql/features/comments.graphql +11 -8
- package/dist/modules/drupal/graphql/features/publishNew.graphql +1 -4
- package/dist/modules/drupal/graphql/features/scheduler.graphql +31 -0
- package/dist/modules/drupal/graphql/features/transform.graphql +9 -1
- package/dist/modules/drupal/graphql/features/transform_host.graphql +38 -0
- package/dist/modules/drupal/graphql/mutations/set_paragraph_schedule.graphql +15 -0
- package/dist/modules/drupal/graphql/mutations/update_host_options.graphql +15 -0
- package/dist/modules/drupal/index.d.mts +1 -1
- package/dist/modules/drupal/index.mjs +79 -9
- package/dist/modules/drupal/runtime/adapter/index.d.ts +3 -0
- package/dist/modules/drupal/{adapter/index.mjs → runtime/adapter/index.js} +166 -20
- package/dist/runtime/adapter/index.d.ts +111 -1
- package/dist/runtime/blokkliPlugins/AddAction/index.vue +27 -3
- package/dist/runtime/blokkliPlugins/BlockIndicator/index.vue +65 -0
- package/dist/runtime/blokkliPlugins/BlockIndicator/index.vue.d.ts +26 -0
- package/dist/runtime/blokkliPlugins/ContextMenu/Menu/index.vue +6 -0
- package/dist/runtime/blokkliPlugins/ContextMenu/index.vue +3 -2
- package/dist/runtime/blokkliPlugins/ContextMenu/index.vue.d.ts +2 -19
- package/dist/runtime/blokkliPlugins/DebugOverlay/index.vue.d.ts +2 -7
- package/dist/runtime/blokkliPlugins/DroppableEdit/index.vue +3 -3
- package/dist/runtime/blokkliPlugins/DroppableEdit/index.vue.d.ts +2 -19
- package/dist/runtime/blokkliPlugins/ItemAction/index.vue +23 -15
- package/dist/runtime/blokkliPlugins/ItemAction/index.vue.d.ts +21 -44
- package/dist/runtime/blokkliPlugins/ItemDropdown/index.vue +49 -11
- package/dist/runtime/blokkliPlugins/ItemDropdown/index.vue.d.ts +29 -15
- package/dist/runtime/blokkliPlugins/MenuButton/index.vue.d.ts +3 -3
- package/dist/runtime/blokkliPlugins/Sidebar/Detached/index.vue +6 -7
- package/dist/runtime/blokkliPlugins/Sidebar/Detached/index.vue.d.ts +2 -51
- package/dist/runtime/blokkliPlugins/Sidebar/index.vue +2 -9
- package/dist/runtime/blokkliPlugins/Sidebar/index.vue.d.ts +15 -9
- package/dist/runtime/blokkliPlugins/ToolbarButton/index.vue.d.ts +1 -1
- package/dist/runtime/blokkliPlugins/TourItem/index.vue +10 -5
- package/dist/runtime/blokkliPlugins/TourItem/index.vue.d.ts +2 -4
- package/dist/runtime/blokkliPlugins/ViewOption/index.vue +6 -3
- package/dist/runtime/blokkliPlugins/ViewOption/index.vue.d.ts +4 -3
- package/dist/runtime/blokkliPlugins/index.d.ts +8 -7
- package/dist/runtime/blokkliPlugins/index.js +15 -13
- package/dist/runtime/components/Blocks/Fragment/icon.svg +1 -1
- package/dist/runtime/components/Blocks/FromLibrary/index.vue +4 -2
- package/dist/runtime/components/BlokkliEditable.vue +34 -16
- package/dist/runtime/components/BlokkliEditable.vue.d.ts +2 -1
- package/dist/runtime/components/BlokkliField.vue +31 -27
- package/dist/runtime/components/BlokkliField.vue.d.ts +61 -17
- package/dist/runtime/components/BlokkliItem.vue +2 -2
- package/dist/runtime/components/BlokkliItem.vue.d.ts +4 -2
- package/dist/runtime/components/BlokkliProvider.vue +60 -45
- package/dist/runtime/components/BlokkliProvider.vue.d.ts +45 -7
- package/dist/runtime/components/Edit/Actions/index.vue +69 -78
- package/dist/runtime/components/Edit/AddListItem/index.vue +2 -5
- package/dist/runtime/components/Edit/AddListItem/index.vue.d.ts +1 -1
- package/dist/runtime/components/Edit/AddListItemIcon/index.vue +19 -0
- package/dist/runtime/components/Edit/AddListItemIcon/index.vue.d.ts +15 -0
- package/dist/runtime/components/Edit/AnimationCanvas/index.vue +436 -25
- package/dist/runtime/components/Edit/AppMenu/index.vue +5 -5
- package/dist/runtime/components/Edit/ArtboardTooltip/index.vue +83 -0
- package/dist/runtime/components/Edit/ArtboardTooltip/index.vue.d.ts +32 -0
- package/dist/runtime/components/Edit/Banner/index.vue +51 -0
- package/dist/runtime/components/Edit/Banner/index.vue.d.ts +18 -0
- package/dist/runtime/components/Edit/BlockProxy/index.vue +3 -1
- package/dist/runtime/components/Edit/BlokkliErrorBoundary.vue.d.ts +2 -13
- package/dist/runtime/components/Edit/Dialog/index.vue +14 -5
- package/dist/runtime/components/Edit/Dialog/index.vue.d.ts +4 -2
- package/dist/runtime/components/Edit/DiffViewer/State.vue +276 -0
- package/dist/runtime/components/Edit/DiffViewer/State.vue.d.ts +16 -0
- package/dist/runtime/components/Edit/DraggableList.vue +20 -50
- package/dist/runtime/components/Edit/DraggableList.vue.d.ts +7 -7
- package/dist/runtime/components/Edit/EditIndicator.vue +118 -44
- package/dist/runtime/components/Edit/EditIndicator.vue.d.ts +3 -0
- package/dist/runtime/components/Edit/EditProvider.vue +192 -80
- package/dist/runtime/components/Edit/EditProvider.vue.d.ts +3 -0
- package/dist/runtime/components/Edit/Features/AddList/index.vue +24 -36
- package/dist/runtime/components/Edit/Features/Analyze/Overlay/fragment.glsl +58 -0
- package/dist/runtime/components/Edit/Features/Analyze/Overlay/index.vue +170 -0
- package/dist/runtime/components/Edit/Features/Analyze/Overlay/index.vue.d.ts +9 -0
- package/dist/runtime/components/Edit/Features/Analyze/Overlay/vertex.glsl +72 -0
- package/dist/runtime/components/Edit/Features/Analyze/Renderer.vue +159 -0
- package/dist/runtime/components/Edit/Features/Analyze/Renderer.vue.d.ts +7 -0
- package/dist/runtime/components/Edit/Features/Analyze/Results/Results.vue +100 -0
- package/dist/runtime/components/Edit/Features/Analyze/Results/Results.vue.d.ts +6 -0
- package/dist/runtime/components/Edit/Features/Analyze/Results/ResultsItem.vue +56 -0
- package/dist/runtime/components/Edit/Features/Analyze/Results/ResultsItem.vue.d.ts +3 -0
- package/dist/runtime/components/Edit/Features/Analyze/Results/ResultsItemNodes.vue +87 -0
- package/dist/runtime/components/Edit/Features/Analyze/Results/ResultsItemNodes.vue.d.ts +7 -0
- package/dist/runtime/components/Edit/Features/Analyze/Results/ResultsItemNodesTarget.vue +105 -0
- package/dist/runtime/components/Edit/Features/Analyze/Results/ResultsItemNodesTarget.vue.d.ts +8 -0
- package/dist/runtime/components/Edit/Features/Analyze/Results/Status.vue +18 -0
- package/dist/runtime/components/Edit/Features/Analyze/Results/Status.vue.d.ts +8 -0
- package/dist/runtime/components/Edit/Features/Analyze/Summary/Chart.vue +92 -0
- package/dist/runtime/components/Edit/Features/Analyze/Summary/Chart.vue.d.ts +17 -0
- package/dist/runtime/components/Edit/Features/Analyze/Summary/index.vue +77 -0
- package/dist/runtime/components/Edit/Features/Analyze/Summary/index.vue.d.ts +6 -0
- package/dist/runtime/components/Edit/Features/Analyze/analyzers/axe.d.ts +12 -0
- package/dist/runtime/components/Edit/Features/Analyze/analyzers/axe.js +75 -0
- package/dist/runtime/components/Edit/Features/Analyze/analyzers/defineAnalyzer.d.ts +4 -0
- package/dist/runtime/components/Edit/Features/Analyze/analyzers/defineAnalyzer.js +5 -0
- package/dist/runtime/components/Edit/Features/Analyze/analyzers/helpers/Context.d.ts +32 -0
- package/dist/runtime/components/Edit/Features/Analyze/analyzers/helpers/Context.js +45 -0
- package/dist/runtime/components/Edit/Features/Analyze/analyzers/helpers/collectTextElements.d.ts +5 -0
- package/dist/runtime/components/Edit/Features/Analyze/analyzers/helpers/collectTextElements.js +95 -0
- package/dist/runtime/components/Edit/Features/Analyze/analyzers/helpers/normalizeArray.d.ts +3 -0
- package/dist/runtime/components/Edit/Features/Analyze/analyzers/helpers/normalizeArray.js +13 -0
- package/dist/runtime/components/Edit/Features/Analyze/analyzers/index.d.ts +2 -0
- package/dist/runtime/components/Edit/Features/Analyze/analyzers/index.js +2 -0
- package/dist/runtime/components/Edit/Features/Analyze/analyzers/readability.d.ts +2 -0
- package/dist/runtime/components/Edit/Features/Analyze/analyzers/readability.js +165 -0
- package/dist/runtime/components/Edit/Features/Analyze/analyzers/types.d.ts +44 -0
- package/dist/runtime/components/Edit/Features/Analyze/analyzers/types.js +0 -0
- package/dist/runtime/components/Edit/Features/Analyze/helper.d.ts +5 -0
- package/dist/runtime/components/Edit/Features/Analyze/helper.js +28 -0
- package/dist/runtime/components/Edit/Features/Analyze/index.vue +44 -0
- package/dist/runtime/components/Edit/Features/Anchors/Renderer.vue +53 -0
- package/dist/runtime/components/Edit/Features/Anchors/index.vue +32 -0
- package/dist/runtime/components/Edit/Features/Artboard/Overview/index.vue +25 -13
- package/dist/runtime/components/Edit/Features/Artboard/Renderer.vue +299 -0
- package/dist/runtime/components/Edit/Features/Artboard/Renderer.vue.d.ts +7 -0
- package/dist/runtime/components/Edit/Features/Artboard/index.vue +10 -217
- package/dist/runtime/components/Edit/Features/Assistant/index.vue +5 -3
- package/dist/runtime/components/Edit/Features/BlockAddList/index.vue +33 -57
- package/dist/runtime/components/Edit/Features/BlockScheduler/Dialog/ScheduleSection.vue +154 -0
- package/dist/runtime/components/Edit/Features/BlockScheduler/Dialog/ScheduleSection.vue.d.ts +27 -0
- package/dist/runtime/components/Edit/Features/BlockScheduler/Dialog/index.vue +222 -0
- package/dist/runtime/components/Edit/Features/BlockScheduler/Dialog/index.vue.d.ts +11 -0
- package/dist/runtime/components/Edit/Features/BlockScheduler/index.vue +96 -0
- package/dist/runtime/components/Edit/Features/BlockScheduler/index.vue.d.ts +2 -0
- package/dist/runtime/components/Edit/Features/Clipboard/index.vue +177 -46
- package/dist/runtime/components/Edit/Features/CommandPalette/Palette/Item/index.vue +51 -0
- package/dist/runtime/components/Edit/Features/CommandPalette/Palette/Item/index.vue.d.ts +17 -0
- package/dist/runtime/components/Edit/Features/CommandPalette/Palette/index.vue +48 -117
- package/dist/runtime/components/Edit/Features/CommandPalette/index.vue +5 -2
- package/dist/runtime/components/Edit/Features/Comments/AddForm/index.vue +35 -20
- package/dist/runtime/components/Edit/Features/Comments/AddForm/index.vue.d.ts +5 -3
- package/dist/runtime/components/Edit/Features/Comments/CommentInput/index.vue +29 -0
- package/dist/runtime/components/Edit/Features/Comments/CommentInput/index.vue.d.ts +13 -0
- package/dist/runtime/components/Edit/Features/Comments/Overlay/Item/index.vue +22 -16
- package/dist/runtime/components/Edit/Features/Comments/Overlay/Item/index.vue.d.ts +1 -0
- package/dist/runtime/components/Edit/Features/Comments/Overlay/index.vue +15 -6
- package/dist/runtime/components/Edit/Features/Comments/index.vue +21 -9
- package/dist/runtime/components/Edit/Features/Conversions/index.vue +16 -21
- package/dist/runtime/components/Edit/Features/Debug/Rects/index.vue +26 -35
- package/dist/runtime/components/Edit/Features/Debug/Renderer.vue +240 -0
- package/dist/runtime/components/Edit/Features/Debug/Renderer.vue.d.ts +6 -0
- package/dist/runtime/components/Edit/Features/Debug/Viewport/index.vue +14 -0
- package/dist/runtime/components/Edit/Features/Debug/index.vue +7 -162
- package/dist/runtime/components/Edit/Features/Delete/index.vue +1 -1
- package/dist/runtime/components/Edit/Features/Diff/DiffView/index.vue +13 -190
- package/dist/runtime/components/Edit/Features/Diff/index.vue +2 -2
- package/dist/runtime/components/Edit/Features/DraggingOverlay/DragItems/index.vue +18 -10
- package/dist/runtime/components/Edit/Features/DraggingOverlay/DropTargets/fragment.glsl +8 -2
- package/dist/runtime/components/Edit/Features/DraggingOverlay/DropTargets/index.vue +111 -121
- package/dist/runtime/components/Edit/Features/DraggingOverlay/DropTargets/index.vue.d.ts +3 -132
- package/dist/runtime/components/Edit/Features/DraggingOverlay/DropTargets/vertex.glsl +2 -1
- package/dist/runtime/components/Edit/Features/DraggingOverlay/index.vue +87 -61
- package/dist/runtime/components/Edit/Features/Duplicate/index.vue +6 -8
- package/dist/runtime/components/Edit/Features/Edit/index.vue +16 -22
- package/dist/runtime/components/Edit/Features/EditForm/Frame/index.vue +3 -3
- package/dist/runtime/components/Edit/Features/EditForm/index.vue +10 -9
- package/dist/runtime/components/Edit/Features/EditableField/Overlay/Frame/index.vue +69 -4
- package/dist/runtime/components/Edit/Features/EditableField/Overlay/Frame/index.vue.d.ts +2 -2
- package/dist/runtime/components/Edit/Features/EditableField/Overlay/Plaintext/index.vue +13 -9
- package/dist/runtime/components/Edit/Features/EditableField/Overlay/index.vue +45 -87
- package/dist/runtime/components/Edit/Features/EditableField/Overlay/index.vue.d.ts +2 -2
- package/dist/runtime/components/Edit/Features/EditableField/index.vue +45 -43
- package/dist/runtime/components/Edit/Features/EditableMask/index.vue +3 -20
- package/dist/runtime/components/Edit/Features/EntityTitle/index.vue +33 -1
- package/dist/runtime/components/Edit/Features/Fragments/Dialog/index.vue +11 -9
- package/dist/runtime/components/Edit/Features/Fragments/index.vue +8 -6
- package/dist/runtime/components/Edit/Features/History/index.vue +39 -13
- package/dist/runtime/components/Edit/Features/Hover/Overlay/fragment.glsl +139 -0
- package/dist/runtime/components/Edit/Features/Hover/Overlay/index.vue +261 -0
- package/dist/runtime/components/Edit/Features/Hover/Overlay/index.vue.d.ts +6 -0
- package/dist/runtime/components/Edit/Features/Hover/Overlay/vertex.glsl +117 -0
- package/dist/runtime/components/Edit/Features/Hover/index.vue +25 -0
- package/dist/runtime/components/Edit/Features/Hover/index.vue.d.ts +2 -0
- package/dist/runtime/components/Edit/Features/ImportExisting/Dialog/index.vue +6 -2
- package/dist/runtime/components/Edit/Features/ImportExisting/index.vue +3 -2
- package/dist/runtime/components/Edit/Features/Library/EditReusable/index.vue +5 -7
- package/dist/runtime/components/Edit/Features/Library/LibraryDialog/index.vue +19 -27
- package/dist/runtime/components/Edit/Features/Library/ReusableDialog/index.vue +32 -28
- package/dist/runtime/components/Edit/Features/Library/index.vue +40 -32
- package/dist/runtime/components/Edit/Features/MediaLibrary/Library/index.vue +11 -11
- package/dist/runtime/components/Edit/Features/MediaLibrary/index.vue +15 -12
- package/dist/runtime/components/Edit/Features/MultiSelect/Overlay/fragment.glsl +1 -1
- package/dist/runtime/components/Edit/Features/MultiSelect/Overlay/index.vue +44 -32
- package/dist/runtime/components/Edit/Features/MultiSelect/Overlay/vertex.glsl +1 -1
- package/dist/runtime/components/Edit/Features/MultiSelect/index.vue +10 -18
- package/dist/runtime/components/Edit/Features/Options/Form/Checkbox/index.vue +3 -2
- package/dist/runtime/components/Edit/Features/Options/Form/Checkbox/index.vue.d.ts +2 -0
- package/dist/runtime/components/Edit/Features/Options/Form/Group.vue.d.ts +2 -11
- package/dist/runtime/components/Edit/Features/Options/Form/Item.vue +14 -3
- package/dist/runtime/components/Edit/Features/Options/Form/Item.vue.d.ts +0 -1
- package/dist/runtime/components/Edit/Features/Options/Form/Radios/index.vue +37 -19
- package/dist/runtime/components/Edit/Features/Options/Form/Radios/index.vue.d.ts +8 -2
- package/dist/runtime/components/Edit/Features/Options/Form/index.vue +88 -42
- package/dist/runtime/components/Edit/Features/Options/Form/index.vue.d.ts +5 -5
- package/dist/runtime/components/Edit/Features/Options/index.vue +35 -11
- package/dist/runtime/components/Edit/Features/Ownership/Renderer.vue +35 -0
- package/dist/runtime/components/Edit/Features/Ownership/Renderer.vue.d.ts +6 -0
- package/dist/runtime/components/Edit/Features/Ownership/index.vue +7 -25
- package/dist/runtime/components/Edit/Features/PreviewGrant/index.vue +3 -3
- package/dist/runtime/components/Edit/Features/ProxyView/index.vue +5 -1
- package/dist/runtime/components/Edit/Features/Publish/Dialog/Item.vue +41 -14
- package/dist/runtime/components/Edit/Features/Publish/Dialog/Item.vue.d.ts +2 -0
- package/dist/runtime/components/Edit/Features/Publish/Dialog/PublishOption.vue +47 -0
- package/dist/runtime/components/Edit/Features/Publish/Dialog/PublishOption.vue.d.ts +19 -0
- package/dist/runtime/components/Edit/Features/Publish/Dialog/Summary.vue +83 -0
- package/dist/runtime/components/Edit/Features/Publish/Dialog/Summary.vue.d.ts +9 -0
- package/dist/runtime/components/Edit/Features/Publish/Dialog/index.vue +439 -123
- package/dist/runtime/components/Edit/Features/Publish/Dialog/index.vue.d.ts +3 -14
- package/dist/runtime/components/Edit/Features/Publish/index.vue +57 -24
- package/dist/runtime/components/Edit/Features/ResponsivePreview/Frame/index.vue.d.ts +2 -13
- package/dist/runtime/components/Edit/Features/Revert/index.vue +3 -3
- package/dist/runtime/components/Edit/Features/Search/Overlay/Results/Page/index.vue +15 -15
- package/dist/runtime/components/Edit/Features/Search/index.vue +7 -3
- package/dist/runtime/components/Edit/Features/Selection/AddButtons/Overlay/index.vue +85 -0
- package/dist/runtime/components/Edit/Features/{CommandPalette/Palette/Group → Selection/AddButtons/Overlay}/index.vue.d.ts +8 -13
- package/dist/runtime/components/Edit/Features/Selection/AddButtons/Renderer/fragment.glsl +106 -0
- package/dist/runtime/components/Edit/Features/Selection/AddButtons/Renderer/index.vue +440 -0
- package/dist/runtime/components/Edit/Features/Selection/AddButtons/Renderer/index.vue.d.ts +32 -0
- package/dist/runtime/components/Edit/Features/Selection/AddButtons/Renderer/vertex.glsl +102 -0
- package/dist/runtime/components/Edit/Features/Selection/AddButtons/index.vue +387 -0
- package/dist/runtime/components/Edit/Features/Selection/AddButtons/index.vue.d.ts +6 -0
- package/dist/runtime/components/Edit/Features/Selection/Overlay/fragment.glsl +15 -10
- package/dist/runtime/components/Edit/Features/Selection/Overlay/index.vue +105 -25
- package/dist/runtime/components/Edit/Features/Selection/Overlay/index.vue.d.ts +5 -3
- package/dist/runtime/components/Edit/Features/Selection/Overlay/vertex.glsl +12 -3
- package/dist/runtime/components/Edit/Features/Selection/OverlayFallback/index.vue +2 -2
- package/dist/runtime/components/Edit/Features/Selection/index.vue +135 -25
- package/dist/runtime/components/Edit/Features/Settings/Dialog/FeatureSetting/index.vue +12 -17
- package/dist/runtime/components/Edit/Features/Settings/index.vue +11 -25
- package/dist/runtime/components/Edit/Features/Structure/List/Field/index.vue +2 -2
- package/dist/runtime/components/Edit/Features/Structure/List/Item/index.vue +13 -6
- package/dist/runtime/components/Edit/Features/Theme/Color/index.vue +5 -1
- package/dist/runtime/components/Edit/Features/Theme/index.vue +2 -1
- package/dist/runtime/components/Edit/Features/TouchActionBar/index.vue +3 -2
- package/dist/runtime/components/Edit/Features/Tour/Overlay/index.vue +3 -0
- package/dist/runtime/components/Edit/Features/Transform/Dialog/index.vue +198 -0
- package/dist/runtime/components/Edit/Features/Transform/Dialog/index.vue.d.ts +13 -0
- package/dist/runtime/components/Edit/Features/Transform/index.vue +156 -70
- package/dist/runtime/components/Edit/Features/Translations/Banner/index.vue +17 -11
- package/dist/runtime/components/Edit/Features/Translations/index.vue +20 -23
- package/dist/runtime/components/Edit/Features/Validations/SidebarItem/index.vue +5 -5
- package/dist/runtime/components/Edit/Features/index.vue +17 -7
- package/dist/runtime/components/Edit/Form/Datepicker/index.vue +198 -0
- package/dist/runtime/components/Edit/Form/Datepicker/index.vue.d.ts +15 -0
- package/dist/runtime/components/Edit/Form/Group/index.vue.d.ts +2 -4
- package/dist/runtime/components/Edit/Form/Item/index.vue.d.ts +2 -4
- package/dist/runtime/components/Edit/Form/Radio/index.vue +33 -0
- package/dist/runtime/components/Edit/Form/Radio/index.vue.d.ts +20 -0
- package/dist/runtime/components/Edit/Form/RadioTabs/index.vue +37 -0
- package/dist/runtime/components/Edit/Form/RadioTabs/index.vue.d.ts +22 -0
- package/dist/runtime/components/Edit/Form/Select/index.vue +29 -0
- package/dist/runtime/components/Edit/Form/Select/index.vue.d.ts +20 -0
- package/dist/runtime/components/Edit/Form/Text/index.vue +34 -0
- package/dist/runtime/components/Edit/Form/Text/index.vue.d.ts +20 -0
- package/dist/runtime/components/Edit/Form/Textarea/index.vue +13 -6
- package/dist/runtime/components/Edit/Form/Textarea/index.vue.d.ts +4 -0
- package/dist/runtime/components/Edit/Form/Toggle/index.vue +4 -3
- package/dist/runtime/components/Edit/Form/Toggle/index.vue.d.ts +12 -2
- package/dist/runtime/components/Edit/FormOverlay/index.vue +1 -1
- package/dist/runtime/components/Edit/FormOverlay/index.vue.d.ts +3 -2
- package/dist/runtime/components/Edit/Indicators/index.vue +123 -0
- package/dist/runtime/components/Edit/Indicators/index.vue.d.ts +2 -0
- package/dist/runtime/components/Edit/InfoBox/index.vue +6 -2
- package/dist/runtime/components/Edit/InfoBox/index.vue.d.ts +12 -2
- package/dist/runtime/components/Edit/ItemIcon/index.vue +2 -1
- package/dist/runtime/components/Edit/Konami/Game/PixelGrid.vue +66 -0
- package/dist/runtime/components/Edit/Konami/Game/PixelGrid.vue.d.ts +7 -0
- package/dist/runtime/components/Edit/Konami/Game/blokkli.png +0 -0
- package/dist/runtime/components/Edit/Konami/Game/charmap.d.ts +2 -0
- package/dist/runtime/components/Edit/Konami/Game/charmap.js +168 -0
- package/dist/runtime/components/Edit/Konami/Game/index.vue +752 -0
- package/dist/runtime/components/Edit/Konami/Game/index.vue.d.ts +6 -0
- package/dist/runtime/components/Edit/Konami/Game/textRendering.d.ts +8 -0
- package/dist/runtime/components/Edit/Konami/Game/textRendering.js +138 -0
- package/dist/runtime/components/Edit/Konami/Game/useIconRendering.d.ts +9 -0
- package/dist/runtime/components/Edit/Konami/Game/useIconRendering.js +130 -0
- package/dist/runtime/components/Edit/Konami/index.vue +44 -0
- package/dist/runtime/components/Edit/Konami/index.vue.d.ts +2 -0
- package/dist/runtime/components/Edit/Loading/index.vue +6 -2
- package/dist/runtime/components/Edit/Loading/index.vue.d.ts +2 -0
- package/dist/runtime/components/Edit/Messages/index.vue +8 -3
- package/dist/runtime/components/Edit/PluginConfigForm/Checkbox/index.vue +17 -0
- package/dist/runtime/components/Edit/PluginConfigForm/Checkbox/index.vue.d.ts +11 -0
- package/dist/runtime/components/Edit/PluginConfigForm/Options/index.vue +37 -0
- package/dist/runtime/components/Edit/PluginConfigForm/Options/index.vue.d.ts +11 -0
- package/dist/runtime/components/Edit/PluginConfigForm/Text/index.vue +43 -0
- package/dist/runtime/components/Edit/PluginConfigForm/Text/index.vue.d.ts +11 -0
- package/dist/runtime/components/Edit/PluginConfigForm/index.vue +57 -0
- package/dist/runtime/components/Edit/PluginConfigForm/index.vue.d.ts +16 -0
- package/dist/runtime/components/Edit/PreviewProvider.vue +3 -4
- package/dist/runtime/components/Edit/RelativeTime/index.vue +3 -2
- package/dist/runtime/components/Edit/RelativeTime/index.vue.d.ts +2 -2
- package/dist/runtime/components/Edit/Resizable/index.vue.d.ts +1 -1
- package/dist/runtime/components/Edit/ScaleToFit/index.vue.d.ts +1 -1
- package/dist/runtime/components/Edit/ScheduleDate/index.vue +131 -0
- package/dist/runtime/components/Edit/ScheduleDate/index.vue.d.ts +23 -0
- package/dist/runtime/components/Edit/ScrollBoundary/index.vue.d.ts +2 -7
- package/dist/runtime/components/Edit/ShortcutIndicator/index.vue +11 -3
- package/dist/runtime/components/Edit/Sortli/index.vue.d.ts +1 -1
- package/dist/runtime/components/Edit/SystemRequirements/index.vue +3 -3
- package/dist/runtime/components/Edit/Toolbar/index.vue +3 -2
- package/dist/runtime/components/Edit/Transition/Height.vue +95 -0
- package/dist/runtime/components/Edit/Transition/Height.vue.d.ts +36 -0
- package/dist/runtime/components/Edit/Transition/index.vue +41 -0
- package/dist/runtime/components/Edit/Transition/index.vue.d.ts +19 -0
- package/dist/runtime/components/Edit/ViewportBlockingRect/index.vue.d.ts +2 -7
- package/dist/runtime/components/Edit/index.d.ts +28 -15
- package/dist/runtime/components/Edit/index.js +54 -28
- package/dist/runtime/composables/defineBlokkli.js +16 -3
- package/dist/runtime/composables/defineBlokkliFeature.d.ts +4 -7
- package/dist/runtime/composables/defineBlokkliFragment.js +8 -1
- package/dist/runtime/composables/defineBlokkliProvider.d.ts +11 -0
- package/dist/runtime/composables/defineBlokkliProvider.js +46 -0
- package/dist/runtime/composables/useBlokkliHelper.d.ts +19 -0
- package/dist/runtime/composables/useBlokkliHelper.js +95 -0
- package/dist/runtime/constants/index.d.ts +3 -0
- package/dist/runtime/constants/index.js +3 -0
- package/dist/runtime/css/output.css +1 -1
- package/dist/runtime/helpers/addElementClasses.d.ts +2 -0
- package/dist/runtime/helpers/addElementClasses.js +24 -0
- package/dist/runtime/helpers/animationProvider.d.ts +38 -2
- package/dist/runtime/helpers/animationProvider.js +188 -47
- package/dist/runtime/helpers/bundles/index.d.ts +1 -0
- package/dist/runtime/helpers/bundles/index.js +4 -0
- package/dist/runtime/helpers/composables/defineRenderer.d.ts +8 -0
- package/dist/runtime/helpers/composables/defineRenderer.js +8 -0
- package/dist/runtime/helpers/composables/useBlockRegistration.d.ts +5 -0
- package/dist/runtime/helpers/composables/useBlockRegistration.js +23 -0
- package/dist/runtime/helpers/composables/useDelayedIntersectionObserver.d.ts +1 -1
- package/dist/runtime/helpers/composables/useDelayedIntersectionObserver.js +3 -2
- package/dist/runtime/helpers/composables/useStateBasedCache.d.ts +4 -0
- package/dist/runtime/helpers/composables/useStateBasedCache.js +13 -0
- package/dist/runtime/helpers/composables/useStickyToolbar.d.ts +23 -0
- package/dist/runtime/helpers/composables/useStickyToolbar.js +233 -0
- package/dist/runtime/helpers/definitionProvider.d.ts +3 -2
- package/dist/runtime/helpers/definitionProvider.js +17 -0
- package/dist/runtime/helpers/dom/index.d.ts +60 -0
- package/dist/runtime/helpers/dom/index.js +48 -0
- package/dist/runtime/helpers/domProvider.d.ts +58 -17
- package/dist/runtime/helpers/domProvider.js +320 -245
- package/dist/runtime/helpers/dropTargets/index.d.ts +6 -0
- package/dist/runtime/helpers/dropTargets/index.js +49 -0
- package/dist/runtime/helpers/eventBus.d.ts +1 -1
- package/dist/runtime/helpers/eventBus.js +2 -2
- package/dist/runtime/helpers/index.d.ts +10 -14
- package/dist/runtime/helpers/index.js +58 -121
- package/dist/runtime/helpers/indicatorsProvider.d.ts +10 -0
- package/dist/runtime/helpers/indicatorsProvider.js +23 -0
- package/dist/runtime/helpers/keyboardProvider.d.ts +2 -0
- package/dist/runtime/helpers/keyboardProvider.js +17 -1
- package/dist/runtime/helpers/pluginProvider.d.ts +10 -0
- package/dist/runtime/helpers/pluginProvider.js +33 -0
- package/dist/runtime/helpers/providers/blocks.d.ts +10 -0
- package/dist/runtime/helpers/providers/blocks.js +91 -0
- package/dist/runtime/helpers/providers/directive.d.ts +25 -0
- package/dist/runtime/helpers/providers/directive.js +208 -0
- package/dist/runtime/helpers/providers/element.d.ts +6 -0
- package/dist/runtime/helpers/providers/element.js +35 -0
- package/dist/runtime/helpers/providers/fields.d.ts +8 -0
- package/dist/runtime/helpers/providers/fields.js +47 -0
- package/dist/runtime/helpers/renderCycle.d.ts +1 -0
- package/dist/runtime/helpers/renderCycle.js +10 -0
- package/dist/runtime/helpers/runtimeHelpers/index.js +15 -12
- package/dist/runtime/helpers/selectionProvider.d.ts +27 -11
- package/dist/runtime/helpers/selectionProvider.js +79 -74
- package/dist/runtime/helpers/stateProvider.d.ts +12 -2
- package/dist/runtime/helpers/stateProvider.js +164 -20
- package/dist/runtime/helpers/storageProvider.d.ts +5 -3
- package/dist/runtime/helpers/storageProvider.js +61 -4
- package/dist/runtime/helpers/symbols.d.ts +2 -0
- package/dist/runtime/helpers/symbols.js +2 -0
- package/dist/runtime/helpers/textProvider.js +6 -0
- package/dist/runtime/helpers/themeProvider.d.ts +4 -1
- package/dist/runtime/helpers/themeProvider.js +28 -15
- package/dist/runtime/helpers/transform.js +1 -3
- package/dist/runtime/helpers/typesProvider.js +10 -26
- package/dist/runtime/helpers/uiProvider.d.ts +18 -3
- package/dist/runtime/helpers/uiProvider.js +114 -61
- package/dist/runtime/helpers/useTransitionedValue.d.ts +18 -0
- package/dist/runtime/helpers/useTransitionedValue.js +57 -0
- package/dist/runtime/helpers/webgl/index.d.ts +11 -2
- package/dist/runtime/helpers/webgl/index.js +162 -7
- package/dist/runtime/icons/anchor.svg +1 -0
- package/dist/runtime/icons/arrow-left.svg +1 -1
- package/dist/runtime/icons/arrow-right.svg +1 -1
- package/dist/runtime/icons/arrow-top-right.svg +1 -0
- package/dist/runtime/icons/calendar-clock.svg +1 -0
- package/dist/runtime/icons/calendar.svg +1 -0
- package/dist/runtime/icons/chart.svg +1 -0
- package/dist/runtime/icons/clock.svg +1 -0
- package/dist/runtime/icons/comment_add.svg +1 -5
- package/dist/runtime/icons/copy.svg +1 -0
- package/dist/runtime/icons/cursor-move.svg +1 -1
- package/dist/runtime/icons/delete.svg +1 -8
- package/dist/runtime/icons/diff.svg +1 -1
- package/dist/runtime/icons/duplicate.svg +1 -12
- package/dist/runtime/icons/edit.svg +1 -8
- package/dist/runtime/icons/eye-off.svg +1 -0
- package/dist/runtime/icons/eye.svg +1 -1
- package/dist/runtime/icons/info.svg +1 -1
- package/dist/runtime/icons/link.svg +1 -0
- package/dist/runtime/icons/reusable.svg +1 -5
- package/dist/runtime/icons/speedometer.svg +1 -0
- package/dist/runtime/plugins/blokkliDirectives.js +109 -0
- package/dist/runtime/types/blokkOptions.d.ts +8 -0
- package/dist/runtime/types/index.d.ts +278 -42
- package/dist/runtime/types/theme.d.ts +2 -1
- package/dist/shared/{editor.gz_ac6uT.d.mts → editor.CKsrTpc1.d.mts} +1 -1
- package/package.json +55 -38
- package/dist/modules/drupal/adapter/index.d.mts +0 -6
- package/dist/runtime/components/Edit/DragInteractions/index.vue +0 -364
- package/dist/runtime/components/Edit/Features/CommandPalette/Palette/Group/index.vue +0 -51
- package/dist/runtime/components/Edit/Features/FieldAreas/Overlay/index.vue +0 -22
- package/dist/runtime/components/Edit/Features/FieldAreas/index.vue +0 -41
- package/dist/runtime/plugins/blokkliEditable.js +0 -31
- /package/dist/runtime/components/Edit/{DragInteractions → Features/Analyze}/index.vue.d.ts +0 -0
- /package/dist/runtime/components/Edit/Features/{FieldAreas/Overlay/index.vue.d.ts → Anchors/Renderer.vue.d.ts} +0 -0
- /package/dist/runtime/components/Edit/Features/{FieldAreas → Anchors}/index.vue.d.ts +0 -0
- /package/dist/runtime/plugins/{blokkliEditable.d.ts → blokkliDirectives.d.ts} +0 -0
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { useRuntimeConfig, computed, watch } from "#imports";
|
|
1
|
+
import { useRuntimeConfig, computed } from "#imports";
|
|
3
2
|
import { onlyUnique } from "./index.js";
|
|
4
3
|
class ConfigMap {
|
|
5
4
|
configs = [];
|
|
@@ -52,38 +51,23 @@ export default async function(adapter, selection, context) {
|
|
|
52
51
|
const droppableFieldConfigData = adapter.getDroppableFieldConfig ? await adapter.getDroppableFieldConfig() : [];
|
|
53
52
|
const droppableFieldConfig = new ConfigMap(droppableFieldConfigData);
|
|
54
53
|
const allowedTypesInList = computed(() => {
|
|
55
|
-
if (!selection.
|
|
54
|
+
if (!selection.items.value.length) {
|
|
56
55
|
return [];
|
|
57
56
|
}
|
|
58
57
|
let hostType = "";
|
|
59
58
|
let hostBundle = "";
|
|
60
59
|
let fieldName = "";
|
|
61
|
-
for (let i = 0; i < selection.
|
|
62
|
-
const block = selection.
|
|
63
|
-
if (i !== 0 && (hostType !== block.
|
|
60
|
+
for (let i = 0; i < selection.items.value.length; i++) {
|
|
61
|
+
const block = selection.items.value[i];
|
|
62
|
+
if (i !== 0 && (hostType !== block.host.type || hostBundle !== block.host.bundle || fieldName !== block.host.fieldName)) {
|
|
64
63
|
return [];
|
|
65
64
|
}
|
|
66
|
-
hostType = block.
|
|
67
|
-
hostBundle = block.
|
|
68
|
-
fieldName = block.
|
|
65
|
+
hostType = block.host.type;
|
|
66
|
+
hostBundle = block.host.bundle;
|
|
67
|
+
fieldName = block.host.fieldName;
|
|
69
68
|
}
|
|
70
69
|
return fieldConfig.forName(hostType, hostBundle, fieldName)?.allowedBundles || [];
|
|
71
70
|
});
|
|
72
|
-
watch(selection.blocks, () => {
|
|
73
|
-
if (selection.blocks.value.length !== 1) {
|
|
74
|
-
return;
|
|
75
|
-
}
|
|
76
|
-
const item = selection.blocks.value[0];
|
|
77
|
-
const hasNested = itemBundlesWithNested.includes(item.itemBundle);
|
|
78
|
-
if (hasNested) {
|
|
79
|
-
const nestedFields = fieldConfig.forEntityTypeAndBundle(itemEntityType, item.itemBundle).map((v) => v.name) || [];
|
|
80
|
-
if (nestedFields.length === 1) {
|
|
81
|
-
eventBus.emit("setActiveFieldKey", `${item.uuid}:${nestedFields[0]}`);
|
|
82
|
-
return;
|
|
83
|
-
}
|
|
84
|
-
}
|
|
85
|
-
eventBus.emit("setActiveFieldKey", `${item.hostUuid}:${item.hostFieldName}`);
|
|
86
|
-
});
|
|
87
71
|
const itemBundlesWithNested = fieldConfig.forEntityType(itemEntityType).map((v) => v.entityBundle) || [];
|
|
88
72
|
const typeMap = bundleDefinitions.reduce((acc, type) => {
|
|
89
73
|
acc[type.id] = type;
|
|
@@ -96,8 +80,8 @@ export default async function(adapter, selection, context) {
|
|
|
96
80
|
return fieldConfig.forName(entityType, entityBundle, fieldName);
|
|
97
81
|
}
|
|
98
82
|
function getDroppableFieldConfig(fieldName, host) {
|
|
99
|
-
const entityType = "
|
|
100
|
-
const entityBundle = "
|
|
83
|
+
const entityType = "itemType" in host ? host.block.host.type : host.type;
|
|
84
|
+
const entityBundle = "itemType" in host ? host.block.host.bundle : host.bundle;
|
|
101
85
|
const config = droppableFieldConfig.forName(
|
|
102
86
|
entityType,
|
|
103
87
|
entityBundle,
|
|
@@ -3,10 +3,13 @@ import type { StorageProvider } from './storageProvider.js';
|
|
|
3
3
|
import type { AddListOrientation, Coord, Rectangle, Size } from '#blokkli/types';
|
|
4
4
|
import type { Viewport } from '#blokkli/constants';
|
|
5
5
|
import type { StateProvider } from './stateProvider.js';
|
|
6
|
+
import type { AdapterContext } from '#blokkli/adapter';
|
|
7
|
+
import type { ThemeColorName } from '#blokkli/types/theme';
|
|
8
|
+
import type { ElementProvider } from './providers/element.js';
|
|
6
9
|
export type UiProvider = {
|
|
7
10
|
rootElement: () => HTMLElement;
|
|
8
11
|
artboardElement: () => HTMLElement;
|
|
9
|
-
providerElement:
|
|
12
|
+
providerElement: HTMLElement;
|
|
10
13
|
menu: {
|
|
11
14
|
isOpen: Readonly<Ref<boolean>>;
|
|
12
15
|
close: () => void;
|
|
@@ -14,9 +17,16 @@ export type UiProvider = {
|
|
|
14
17
|
};
|
|
15
18
|
isMobile: ComputedRef<boolean>;
|
|
16
19
|
isDesktop: ComputedRef<boolean>;
|
|
17
|
-
isArtboard: () => boolean;
|
|
18
20
|
isAnimating: Ref<boolean>;
|
|
21
|
+
isAnalyzing: Ref<boolean>;
|
|
19
22
|
isProxyMode: Ref<boolean>;
|
|
23
|
+
hasDialogOpen: Ref<boolean>;
|
|
24
|
+
hasTooltipOpen: ComputedRef<boolean>;
|
|
25
|
+
openTooltip: Ref<string>;
|
|
26
|
+
selectionColor: ComputedRef<ThemeColorName | null>;
|
|
27
|
+
setSelectionColor: (id: string, color: ThemeColorName) => void;
|
|
28
|
+
removeSelectionColor: (id: string) => void;
|
|
29
|
+
hasTransformOverlayOpen: Ref<boolean>;
|
|
20
30
|
isTransforming: ComputedRef<boolean>;
|
|
21
31
|
setTransform: (label?: string | null | undefined) => void;
|
|
22
32
|
transformLabel: ComputedRef<string>;
|
|
@@ -35,7 +45,12 @@ export type UiProvider = {
|
|
|
35
45
|
artboardScale: Ref<number>;
|
|
36
46
|
artboardOffset: Ref<Coord>;
|
|
37
47
|
selectionTopLeft: Ref<Coord>;
|
|
48
|
+
interfaceLanguage: ComputedRef<string>;
|
|
49
|
+
locale: ComputedRef<string>;
|
|
50
|
+
formatDate: (date: string | Date, options?: Intl.DateTimeFormatOptions) => string;
|
|
38
51
|
getAbsoluteElementRect: (v: HTMLElement | Rectangle, scale?: number, offset?: Coord) => Rectangle;
|
|
39
52
|
getViewportRelativeRect: (rect: Rectangle, scale?: number, offset?: Coord) => Rectangle;
|
|
53
|
+
setBannerHeight: (id: string, height: number) => void;
|
|
54
|
+
removeBanner: (id: string) => void;
|
|
40
55
|
};
|
|
41
|
-
export default function (storage: StorageProvider, state: StateProvider): UiProvider;
|
|
56
|
+
export default function (providerElement: HTMLElement, storage: StorageProvider, state: StateProvider, context: ComputedRef<AdapterContext>, element: ElementProvider): UiProvider;
|
|
@@ -2,29 +2,53 @@ import {
|
|
|
2
2
|
onMounted,
|
|
3
3
|
onBeforeUnmount,
|
|
4
4
|
ref,
|
|
5
|
-
computed
|
|
6
|
-
watch
|
|
5
|
+
computed
|
|
7
6
|
} from "vue";
|
|
8
7
|
import { eventBus } from "./eventBus.js";
|
|
9
8
|
import { falsy } from "./index.js";
|
|
10
|
-
|
|
9
|
+
import { addElementClasses } from "./addElementClasses.js";
|
|
10
|
+
import { defaultLanguage, forceDefaultLanguage } from "#blokkli-build/config";
|
|
11
11
|
const CLASS_PROXY_MODE = "bk-is-proxy-mode";
|
|
12
|
-
|
|
12
|
+
const localeMap = {
|
|
13
|
+
de: "de-CH",
|
|
14
|
+
fr: "fr-CH",
|
|
15
|
+
it: "it-CH",
|
|
16
|
+
en: "en-GB"
|
|
17
|
+
};
|
|
18
|
+
export default function(providerElement, storage, state, context, element) {
|
|
13
19
|
let cachedRootElement = null;
|
|
14
20
|
let cachedArtboardElement = null;
|
|
15
|
-
|
|
21
|
+
const interfaceLanguage = computed(() => {
|
|
22
|
+
return forceDefaultLanguage ? defaultLanguage : context.value.language;
|
|
23
|
+
});
|
|
24
|
+
const locale = computed(() => {
|
|
25
|
+
const lang = interfaceLanguage.value;
|
|
26
|
+
return localeMap[lang] || lang;
|
|
27
|
+
});
|
|
16
28
|
const isProxyMode = ref(false);
|
|
17
29
|
const menuIsOpen = ref(false);
|
|
30
|
+
const hasDialogOpen = ref(false);
|
|
31
|
+
const openTooltip = ref("");
|
|
32
|
+
const hasTransformOverlayOpen = ref(false);
|
|
18
33
|
const isAnimating = ref(false);
|
|
34
|
+
const isAnalyzing = ref(false);
|
|
19
35
|
const transformLabel = ref("");
|
|
20
36
|
const openContextMenu = ref("");
|
|
37
|
+
const banners = ref({});
|
|
38
|
+
function setBannerHeight(id, height) {
|
|
39
|
+
banners.value[id] = height;
|
|
40
|
+
}
|
|
41
|
+
function removeBanner(id) {
|
|
42
|
+
banners.value[id] = 0;
|
|
43
|
+
}
|
|
21
44
|
const selectionTopLeft = ref({ x: 0, y: 0 });
|
|
22
|
-
const useAnimationsSetting = storage.use("useAnimations", true);
|
|
23
|
-
const useAnimations = computed(() => useAnimationsSetting.value);
|
|
24
45
|
const baseSettings = storage.use("feature:settings:settings", {});
|
|
25
46
|
const lowPerformanceMode = computed(
|
|
26
47
|
() => baseSettings.value.lowPerformanceMode
|
|
27
48
|
);
|
|
49
|
+
const useAnimations = computed(
|
|
50
|
+
() => baseSettings.value.useAnimations !== false
|
|
51
|
+
);
|
|
28
52
|
const viewportBlockingRectsMap = ref(
|
|
29
53
|
{}
|
|
30
54
|
);
|
|
@@ -61,7 +85,11 @@ export default function(storage, state) {
|
|
|
61
85
|
if (cachedArtboardElement) {
|
|
62
86
|
return cachedArtboardElement;
|
|
63
87
|
}
|
|
64
|
-
const el =
|
|
88
|
+
const el = element.query(
|
|
89
|
+
document.documentElement,
|
|
90
|
+
".bk-main-canvas",
|
|
91
|
+
"Get main canvas."
|
|
92
|
+
);
|
|
65
93
|
if (!el || !(el instanceof HTMLElement)) {
|
|
66
94
|
throw new Error("Failed to locate artboard element.");
|
|
67
95
|
}
|
|
@@ -72,24 +100,17 @@ export default function(storage, state) {
|
|
|
72
100
|
if (cachedRootElement) {
|
|
73
101
|
return cachedRootElement;
|
|
74
102
|
}
|
|
75
|
-
const el =
|
|
103
|
+
const el = element.query(
|
|
104
|
+
document.documentElement,
|
|
105
|
+
"#nuxt-root",
|
|
106
|
+
"Get Nuxt root element."
|
|
107
|
+
);
|
|
76
108
|
if (!el || !(el instanceof HTMLElement)) {
|
|
77
109
|
throw new Error("Failed to locate root Nuxt element.");
|
|
78
110
|
}
|
|
79
111
|
cachedRootElement = el;
|
|
80
112
|
return el;
|
|
81
113
|
};
|
|
82
|
-
const providerElement = () => {
|
|
83
|
-
if (cachedProviderElement) {
|
|
84
|
-
return cachedProviderElement;
|
|
85
|
-
}
|
|
86
|
-
const el = document.querySelector('[data-blokkli-provider-active="true"]');
|
|
87
|
-
if (!el || !(el instanceof HTMLElement)) {
|
|
88
|
-
throw new Error("Failed to locate provider element.");
|
|
89
|
-
}
|
|
90
|
-
cachedProviderElement = el;
|
|
91
|
-
return el;
|
|
92
|
-
};
|
|
93
114
|
const appViewport = computed(() => {
|
|
94
115
|
if (viewportWidth.value < 1024) {
|
|
95
116
|
return "mobile";
|
|
@@ -109,16 +130,6 @@ export default function(storage, state) {
|
|
|
109
130
|
eventBus.emit("ui:resized");
|
|
110
131
|
}, 400);
|
|
111
132
|
};
|
|
112
|
-
const isArtboard = () => {
|
|
113
|
-
return document.documentElement.classList.contains(ARTBOARD_CLASS);
|
|
114
|
-
};
|
|
115
|
-
watch(isAnimating, (is) => {
|
|
116
|
-
if (is) {
|
|
117
|
-
document.documentElement.classList.add("bk-is-animating");
|
|
118
|
-
} else {
|
|
119
|
-
document.documentElement.classList.remove("bk-is-animating");
|
|
120
|
-
}
|
|
121
|
-
});
|
|
122
133
|
const toolbarHeight = computed(() => {
|
|
123
134
|
if (isMobile.value) {
|
|
124
135
|
return 80;
|
|
@@ -167,6 +178,11 @@ export default function(storage, state) {
|
|
|
167
178
|
height -= 70;
|
|
168
179
|
}
|
|
169
180
|
}
|
|
181
|
+
const bannerHeights = Object.values(banners.value).filter(Boolean);
|
|
182
|
+
bannerHeights.forEach((bannerHeight) => {
|
|
183
|
+
height -= bannerHeight;
|
|
184
|
+
});
|
|
185
|
+
height -= bannerHeights.length * 10;
|
|
170
186
|
return height;
|
|
171
187
|
});
|
|
172
188
|
const blockingPaddingX = computed(() => 15);
|
|
@@ -200,35 +216,6 @@ export default function(storage, state) {
|
|
|
200
216
|
height: visibleViewportHeight.value - 20
|
|
201
217
|
};
|
|
202
218
|
});
|
|
203
|
-
function setProxyModeClass() {
|
|
204
|
-
document.documentElement.classList.remove(CLASS_PROXY_MODE);
|
|
205
|
-
if (isProxyMode.value) {
|
|
206
|
-
document.documentElement.classList.add(CLASS_PROXY_MODE);
|
|
207
|
-
}
|
|
208
|
-
}
|
|
209
|
-
watch(isProxyMode, setProxyModeClass);
|
|
210
|
-
onMounted(() => {
|
|
211
|
-
document.documentElement.classList.add("bk-html-root");
|
|
212
|
-
document.body.classList.add("bk-body");
|
|
213
|
-
document.documentElement.classList.add(ARTBOARD_CLASS);
|
|
214
|
-
setProxyModeClass();
|
|
215
|
-
viewportWidth.value = window.innerWidth;
|
|
216
|
-
viewportHeight.value = window.innerHeight;
|
|
217
|
-
window.addEventListener("resize", onResize);
|
|
218
|
-
const artboard = artboardElement();
|
|
219
|
-
resizeObserver.observe(artboard);
|
|
220
|
-
});
|
|
221
|
-
onBeforeUnmount(() => {
|
|
222
|
-
window.removeEventListener("resize", onResize);
|
|
223
|
-
document.documentElement.classList.remove("bk-html-root");
|
|
224
|
-
document.body.classList.remove("bk-body");
|
|
225
|
-
document.documentElement.classList.remove(ARTBOARD_CLASS);
|
|
226
|
-
document.documentElement.classList.remove(CLASS_PROXY_MODE);
|
|
227
|
-
clearTimeout(resizeTimeout);
|
|
228
|
-
const artboard = artboardElement();
|
|
229
|
-
resizeObserver.unobserve(artboard);
|
|
230
|
-
resizeObserver.disconnect();
|
|
231
|
-
});
|
|
232
219
|
const viewport = computed(() => {
|
|
233
220
|
return {
|
|
234
221
|
width: viewportWidth.value,
|
|
@@ -260,6 +247,60 @@ export default function(storage, state) {
|
|
|
260
247
|
function setTransform(label) {
|
|
261
248
|
transformLabel.value = label || "";
|
|
262
249
|
}
|
|
250
|
+
function formatDate(date, options) {
|
|
251
|
+
const dateObj = typeof date === "string" ? new Date(date) : date;
|
|
252
|
+
const defaultOptions = {
|
|
253
|
+
year: "numeric",
|
|
254
|
+
month: "2-digit",
|
|
255
|
+
day: "2-digit",
|
|
256
|
+
hour: "2-digit",
|
|
257
|
+
minute: "2-digit"
|
|
258
|
+
};
|
|
259
|
+
return dateObj.toLocaleString(locale.value, options || defaultOptions);
|
|
260
|
+
}
|
|
261
|
+
addElementClasses(document.documentElement, "bk-is-animating", isAnimating);
|
|
262
|
+
addElementClasses(
|
|
263
|
+
document.documentElement,
|
|
264
|
+
"bk-has-sidebar-left",
|
|
265
|
+
activeSidebarLeft
|
|
266
|
+
);
|
|
267
|
+
addElementClasses(
|
|
268
|
+
document.documentElement,
|
|
269
|
+
"bk-has-sidebar-right",
|
|
270
|
+
activeSidebarRight
|
|
271
|
+
);
|
|
272
|
+
addElementClasses(document.documentElement, ["bk-html-root"]);
|
|
273
|
+
addElementClasses(document.body, "bk-body");
|
|
274
|
+
addElementClasses(document.documentElement, CLASS_PROXY_MODE, isProxyMode);
|
|
275
|
+
addElementClasses(document.documentElement, "bk-is-analyzing", isAnalyzing);
|
|
276
|
+
onMounted(() => {
|
|
277
|
+
viewportWidth.value = window.innerWidth;
|
|
278
|
+
viewportHeight.value = window.innerHeight;
|
|
279
|
+
window.addEventListener("resize", onResize);
|
|
280
|
+
const artboard = artboardElement();
|
|
281
|
+
resizeObserver.observe(artboard);
|
|
282
|
+
});
|
|
283
|
+
onBeforeUnmount(() => {
|
|
284
|
+
window.removeEventListener("resize", onResize);
|
|
285
|
+
clearTimeout(resizeTimeout);
|
|
286
|
+
const artboard = artboardElement();
|
|
287
|
+
resizeObserver.unobserve(artboard);
|
|
288
|
+
resizeObserver.disconnect();
|
|
289
|
+
});
|
|
290
|
+
const hasTooltipOpen = computed(() => !!openTooltip.value);
|
|
291
|
+
const selectionColors = ref([]);
|
|
292
|
+
function setSelectionColor(id, color) {
|
|
293
|
+
selectionColors.value = [
|
|
294
|
+
...selectionColors.value.filter((v) => v.id !== id),
|
|
295
|
+
{ id, color }
|
|
296
|
+
];
|
|
297
|
+
}
|
|
298
|
+
function removeSelectionColor(id) {
|
|
299
|
+
selectionColors.value = selectionColors.value.filter((v) => v.id !== id);
|
|
300
|
+
}
|
|
301
|
+
const selectionColor = computed(() => {
|
|
302
|
+
return selectionColors.value[selectionColors.value.length - 1]?.color ?? null;
|
|
303
|
+
});
|
|
263
304
|
return {
|
|
264
305
|
menu: {
|
|
265
306
|
isOpen: menuIsOpen,
|
|
@@ -271,8 +312,8 @@ export default function(storage, state) {
|
|
|
271
312
|
providerElement,
|
|
272
313
|
isMobile,
|
|
273
314
|
isDesktop,
|
|
274
|
-
isArtboard,
|
|
275
315
|
isAnimating,
|
|
316
|
+
isAnalyzing,
|
|
276
317
|
isTransforming,
|
|
277
318
|
setTransform,
|
|
278
319
|
transformLabel: computed(() => transformLabel.value),
|
|
@@ -293,6 +334,18 @@ export default function(storage, state) {
|
|
|
293
334
|
selectionTopLeft,
|
|
294
335
|
lowPerformanceMode,
|
|
295
336
|
getAbsoluteElementRect,
|
|
296
|
-
getViewportRelativeRect
|
|
337
|
+
getViewportRelativeRect,
|
|
338
|
+
interfaceLanguage,
|
|
339
|
+
locale,
|
|
340
|
+
formatDate,
|
|
341
|
+
hasDialogOpen,
|
|
342
|
+
hasTransformOverlayOpen,
|
|
343
|
+
hasTooltipOpen,
|
|
344
|
+
openTooltip,
|
|
345
|
+
selectionColor,
|
|
346
|
+
setSelectionColor,
|
|
347
|
+
removeSelectionColor,
|
|
348
|
+
setBannerHeight,
|
|
349
|
+
removeBanner
|
|
297
350
|
};
|
|
298
351
|
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { RGB } from '#blokkli/types/theme';
|
|
2
|
+
interface TransitionOptions {
|
|
3
|
+
/**
|
|
4
|
+
* Duration in milliseconds.
|
|
5
|
+
*/
|
|
6
|
+
duration?: number;
|
|
7
|
+
/**
|
|
8
|
+
* The easing method. Defaults to "ease out quad".
|
|
9
|
+
*/
|
|
10
|
+
easing?: (t: number) => number;
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* Creates a computed property from the given callback and transitions between values.
|
|
14
|
+
*
|
|
15
|
+
* Returns a method that, when called, will return the current transitioned value.
|
|
16
|
+
*/
|
|
17
|
+
export declare function useTransitionedValue<T extends RGB | number>(valueCallback: () => T, options?: TransitionOptions): () => T;
|
|
18
|
+
export {};
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import { computed, watch } from "vue";
|
|
2
|
+
import { easeOutQuad } from "./easing.js";
|
|
3
|
+
function isRGB(value) {
|
|
4
|
+
return Array.isArray(value) && value.length === 3;
|
|
5
|
+
}
|
|
6
|
+
function lerp(start, end, t) {
|
|
7
|
+
return start + (end - start) * t;
|
|
8
|
+
}
|
|
9
|
+
function interpolateColor(from, to, t) {
|
|
10
|
+
return [
|
|
11
|
+
lerp(from[0], to[0], t),
|
|
12
|
+
lerp(from[1], to[1], t),
|
|
13
|
+
lerp(from[2], to[2], t)
|
|
14
|
+
];
|
|
15
|
+
}
|
|
16
|
+
function interpolateValue(from, to, t) {
|
|
17
|
+
if (isRGB(from) && isRGB(to)) {
|
|
18
|
+
return interpolateColor(from, to, t);
|
|
19
|
+
} else if (typeof from === "number" && typeof to === "number") {
|
|
20
|
+
return lerp(from, to, t);
|
|
21
|
+
}
|
|
22
|
+
return to;
|
|
23
|
+
}
|
|
24
|
+
function cloneValue(value) {
|
|
25
|
+
if (isRGB(value)) {
|
|
26
|
+
return [...value];
|
|
27
|
+
}
|
|
28
|
+
return value;
|
|
29
|
+
}
|
|
30
|
+
export function useTransitionedValue(valueCallback, options = {}) {
|
|
31
|
+
const { duration = 300, easing = easeOutQuad } = options;
|
|
32
|
+
const value = computed(valueCallback);
|
|
33
|
+
const initial = value.value;
|
|
34
|
+
let current = cloneValue(initial);
|
|
35
|
+
let target = cloneValue(initial);
|
|
36
|
+
let from = cloneValue(initial);
|
|
37
|
+
let startTime = null;
|
|
38
|
+
watch(value, (newValue) => {
|
|
39
|
+
from = cloneValue(current);
|
|
40
|
+
target = cloneValue(newValue);
|
|
41
|
+
startTime = Date.now();
|
|
42
|
+
});
|
|
43
|
+
return function getCurrentValue() {
|
|
44
|
+
if (startTime !== null) {
|
|
45
|
+
const elapsed = Date.now() - startTime;
|
|
46
|
+
const rawProgress = Math.min(elapsed / duration, 1);
|
|
47
|
+
if (rawProgress >= 1) {
|
|
48
|
+
current = cloneValue(target);
|
|
49
|
+
startTime = null;
|
|
50
|
+
} else {
|
|
51
|
+
const easedProgress = easing(rawProgress);
|
|
52
|
+
current = interpolateValue(from, target, easedProgress);
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
return current;
|
|
56
|
+
};
|
|
57
|
+
}
|
|
@@ -8,10 +8,16 @@ type RectangleBufferRect = Rectangle & {
|
|
|
8
8
|
};
|
|
9
9
|
type RectangleBufferCollectorOptions = {
|
|
10
10
|
padding?: number;
|
|
11
|
+
deferredMode?: boolean;
|
|
11
12
|
};
|
|
12
13
|
type PlacedRectangle = Rectangle & {
|
|
13
14
|
originalY: number;
|
|
14
15
|
};
|
|
16
|
+
type PendingRect<T> = {
|
|
17
|
+
rect: Omit<T, 'index'>;
|
|
18
|
+
type: number;
|
|
19
|
+
checkOverlap: boolean;
|
|
20
|
+
};
|
|
15
21
|
export declare class RectangleBufferCollector<T extends RectangleBufferRect> {
|
|
16
22
|
gl?: WebGLRenderingContext;
|
|
17
23
|
added: Set<string>;
|
|
@@ -26,10 +32,13 @@ export declare class RectangleBufferCollector<T extends RectangleBufferRect> {
|
|
|
26
32
|
index: number;
|
|
27
33
|
bufferInfo: BufferInfo | null;
|
|
28
34
|
placedRects: PlacedRectangle[];
|
|
29
|
-
|
|
35
|
+
deferredMode: boolean;
|
|
36
|
+
pendingRects: PendingRect<T>[];
|
|
37
|
+
constructor(gl?: WebGLRenderingContext, options?: RectangleBufferCollectorOptions);
|
|
30
38
|
reset(): void;
|
|
31
|
-
getIdealPosition(x: number, y: number, width: number, height: number): Rectangle;
|
|
39
|
+
getIdealPosition(x: number, y: number, width: number, height: number, isEmptyField?: boolean): Rectangle;
|
|
32
40
|
addRectangle(rect: Omit<T, 'index'>, type: number, checkOverlap?: boolean): void;
|
|
41
|
+
processPendingRects(): void;
|
|
33
42
|
getIndex(id: string): number | undefined;
|
|
34
43
|
updateRectangle(): void;
|
|
35
44
|
createBufferInfo(): BufferInfo | null;
|
|
@@ -14,12 +14,18 @@ export class RectangleBufferCollector {
|
|
|
14
14
|
index = 0;
|
|
15
15
|
bufferInfo = null;
|
|
16
16
|
placedRects = [];
|
|
17
|
-
|
|
17
|
+
deferredMode = false;
|
|
18
|
+
pendingRects = [];
|
|
19
|
+
constructor(gl, options) {
|
|
18
20
|
this.gl = gl;
|
|
21
|
+
this.deferredMode = options?.deferredMode || false;
|
|
19
22
|
}
|
|
20
23
|
reset() {
|
|
21
24
|
this.added = /* @__PURE__ */ new Set();
|
|
22
|
-
this.
|
|
25
|
+
if (!this.deferredMode) {
|
|
26
|
+
this.rects = {};
|
|
27
|
+
}
|
|
28
|
+
this.placedRects = [];
|
|
23
29
|
this.positions = [];
|
|
24
30
|
this.indices = [];
|
|
25
31
|
this.rectId = [];
|
|
@@ -29,8 +35,10 @@ export class RectangleBufferCollector {
|
|
|
29
35
|
this.radius = [];
|
|
30
36
|
this.index = 0;
|
|
31
37
|
this.bufferInfo = null;
|
|
38
|
+
this.pendingRects = [];
|
|
32
39
|
}
|
|
33
|
-
getIdealPosition(x, y, width, height) {
|
|
40
|
+
getIdealPosition(x, y, width, height, isEmptyField = false) {
|
|
41
|
+
const MIN_HEIGHT = 5;
|
|
34
42
|
const rect = {
|
|
35
43
|
x,
|
|
36
44
|
y,
|
|
@@ -40,19 +48,63 @@ export class RectangleBufferCollector {
|
|
|
40
48
|
};
|
|
41
49
|
const intersections = [];
|
|
42
50
|
for (let i = 0; i < this.placedRects.length; i++) {
|
|
43
|
-
|
|
44
|
-
|
|
51
|
+
const placed = this.placedRects[i];
|
|
52
|
+
const testRect = { ...rect, height: Math.max(height, MIN_HEIGHT) };
|
|
53
|
+
const testPlaced = {
|
|
54
|
+
...placed,
|
|
55
|
+
height: Math.max(placed.height, MIN_HEIGHT)
|
|
56
|
+
};
|
|
57
|
+
if (intersects(testRect, testPlaced)) {
|
|
58
|
+
intersections.push(placed);
|
|
45
59
|
}
|
|
46
60
|
}
|
|
47
61
|
if (intersections.length === 0) {
|
|
48
62
|
this.placedRects.push(rect);
|
|
49
63
|
return rect;
|
|
50
64
|
}
|
|
51
|
-
intersections.sort((a, b) =>
|
|
65
|
+
intersections.sort((a, b) => a.originalY - b.originalY);
|
|
66
|
+
if (isEmptyField) {
|
|
67
|
+
for (let i = 0; i < intersections.length; i++) {
|
|
68
|
+
const existingRect = intersections[i];
|
|
69
|
+
const rectsAbove = this.placedRects.filter(
|
|
70
|
+
(r) => r.y + r.height <= existingRect.y && r.x < x + width && r.x + r.width > x
|
|
71
|
+
);
|
|
72
|
+
let prevBottom = 0;
|
|
73
|
+
if (rectsAbove.length > 0) {
|
|
74
|
+
prevBottom = Math.max(...rectsAbove.map((r) => r.y + r.height));
|
|
75
|
+
}
|
|
76
|
+
const nextTop = existingRect.y;
|
|
77
|
+
const availableSpace = nextTop - prevBottom;
|
|
78
|
+
if (availableSpace >= height) {
|
|
79
|
+
const centeredY = prevBottom + (availableSpace - height) / 2;
|
|
80
|
+
const centeredRect = { ...rect, y: centeredY };
|
|
81
|
+
let hasIntersection = false;
|
|
82
|
+
for (const placed of this.placedRects) {
|
|
83
|
+
const testCentered = {
|
|
84
|
+
...centeredRect,
|
|
85
|
+
height: Math.max(height, MIN_HEIGHT)
|
|
86
|
+
};
|
|
87
|
+
const testPlaced = {
|
|
88
|
+
...placed,
|
|
89
|
+
height: Math.max(placed.height, MIN_HEIGHT)
|
|
90
|
+
};
|
|
91
|
+
if (intersects(testCentered, testPlaced)) {
|
|
92
|
+
hasIntersection = true;
|
|
93
|
+
break;
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
if (!hasIntersection) {
|
|
97
|
+
rect.y = centeredY;
|
|
98
|
+
this.placedRects.push(rect);
|
|
99
|
+
return rect;
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
}
|
|
52
104
|
for (let i = 0; i < intersections.length; i++) {
|
|
53
105
|
const existingRect = intersections[i];
|
|
54
106
|
let iterations = 0;
|
|
55
|
-
const direction = y
|
|
107
|
+
const direction = y < existingRect.originalY ? -1 : 1;
|
|
56
108
|
while (intersects(rect, existingRect) && iterations < 10) {
|
|
57
109
|
rect.y = y + direction * (10 * (iterations + 1));
|
|
58
110
|
iterations++;
|
|
@@ -65,6 +117,10 @@ export class RectangleBufferCollector {
|
|
|
65
117
|
return rect;
|
|
66
118
|
}
|
|
67
119
|
addRectangle(rect, type, checkOverlap = false) {
|
|
120
|
+
if (this.deferredMode) {
|
|
121
|
+
this.pendingRects.push({ rect, type, checkOverlap });
|
|
122
|
+
return;
|
|
123
|
+
}
|
|
68
124
|
const { x, y, width, height } = checkOverlap ? this.getIdealPosition(rect.x, rect.y, rect.width, rect.height) : rect;
|
|
69
125
|
this.positions.push(
|
|
70
126
|
x,
|
|
@@ -119,6 +175,105 @@ export class RectangleBufferCollector {
|
|
|
119
175
|
this.added.add(rect.id);
|
|
120
176
|
this.index++;
|
|
121
177
|
}
|
|
178
|
+
processPendingRects() {
|
|
179
|
+
if (!this.deferredMode) {
|
|
180
|
+
return;
|
|
181
|
+
}
|
|
182
|
+
if (!this.pendingRects.length) {
|
|
183
|
+
return;
|
|
184
|
+
}
|
|
185
|
+
const sortedPending = [...this.pendingRects].sort(
|
|
186
|
+
(a, b) => a.rect.y - b.rect.y
|
|
187
|
+
);
|
|
188
|
+
const passes = [
|
|
189
|
+
sortedPending.filter((p) => !p.rect.id.includes(":empty:")),
|
|
190
|
+
// Non-empty rects
|
|
191
|
+
sortedPending.filter((p) => p.rect.id.includes(":empty:"))
|
|
192
|
+
// Empty rects
|
|
193
|
+
];
|
|
194
|
+
for (const pass of passes) {
|
|
195
|
+
for (const { rect, type, checkOverlap } of pass) {
|
|
196
|
+
if (this.added.has(rect.id)) {
|
|
197
|
+
continue;
|
|
198
|
+
}
|
|
199
|
+
let finalPosition;
|
|
200
|
+
const existing = this.rects[rect.id];
|
|
201
|
+
if (existing) {
|
|
202
|
+
finalPosition = {
|
|
203
|
+
x: existing.x,
|
|
204
|
+
y: existing.y,
|
|
205
|
+
width: existing.width,
|
|
206
|
+
height: existing.height
|
|
207
|
+
};
|
|
208
|
+
} else if (checkOverlap) {
|
|
209
|
+
const isEmptyField = rect.id.includes(":empty:");
|
|
210
|
+
finalPosition = this.getIdealPosition(
|
|
211
|
+
rect.x,
|
|
212
|
+
rect.y,
|
|
213
|
+
rect.width,
|
|
214
|
+
rect.height,
|
|
215
|
+
isEmptyField
|
|
216
|
+
);
|
|
217
|
+
} else {
|
|
218
|
+
finalPosition = {
|
|
219
|
+
x: rect.x,
|
|
220
|
+
y: rect.y,
|
|
221
|
+
width: rect.width,
|
|
222
|
+
height: rect.height
|
|
223
|
+
};
|
|
224
|
+
}
|
|
225
|
+
const { x, y, width, height } = finalPosition;
|
|
226
|
+
this.positions.push(
|
|
227
|
+
x,
|
|
228
|
+
y,
|
|
229
|
+
// Lower left corner
|
|
230
|
+
0,
|
|
231
|
+
x + width,
|
|
232
|
+
y,
|
|
233
|
+
// Lower right corner
|
|
234
|
+
1,
|
|
235
|
+
x + width,
|
|
236
|
+
y + height,
|
|
237
|
+
// Upper right corner
|
|
238
|
+
2,
|
|
239
|
+
x,
|
|
240
|
+
y + height,
|
|
241
|
+
// Upper left corner
|
|
242
|
+
3
|
|
243
|
+
);
|
|
244
|
+
const baseIndex = 4 * this.index;
|
|
245
|
+
this.indices.push(
|
|
246
|
+
baseIndex,
|
|
247
|
+
baseIndex + 1,
|
|
248
|
+
baseIndex + 2,
|
|
249
|
+
baseIndex,
|
|
250
|
+
baseIndex + 2,
|
|
251
|
+
baseIndex + 3
|
|
252
|
+
);
|
|
253
|
+
const r = rect.radius || [4, 4, 4, 4];
|
|
254
|
+
this.radius.push(...r, ...r, ...r, ...r);
|
|
255
|
+
this.rectId.push(this.index, this.index, this.index, this.index);
|
|
256
|
+
this.types.push(type, type, type, type);
|
|
257
|
+
this.quad.push(x, y, width, height);
|
|
258
|
+
this.quad.push(x, y, width, height);
|
|
259
|
+
this.quad.push(x, y, width, height);
|
|
260
|
+
this.quad.push(x, y, width, height);
|
|
261
|
+
const state = rect.state || 0;
|
|
262
|
+
this.state.push(state, state, state, state);
|
|
263
|
+
this.rects[rect.id] = {
|
|
264
|
+
...rect,
|
|
265
|
+
index: this.index,
|
|
266
|
+
x,
|
|
267
|
+
y,
|
|
268
|
+
width,
|
|
269
|
+
height
|
|
270
|
+
};
|
|
271
|
+
this.added.add(rect.id);
|
|
272
|
+
this.index++;
|
|
273
|
+
}
|
|
274
|
+
this.pendingRects = [];
|
|
275
|
+
}
|
|
276
|
+
}
|
|
122
277
|
getIndex(id) {
|
|
123
278
|
return this.rects[id]?.index;
|
|
124
279
|
}
|