@blokkli/editor 2.0.0-alpha.22 → 2.0.0-alpha.24
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.json +1 -1
- package/dist/module.mjs +150 -226
- package/dist/runtime/blokkliPlugins/ContextMenu/index.vue +1 -1
- package/dist/runtime/blokkliPlugins/Sidebar/Detached/index.vue +20 -14
- package/dist/runtime/blokkliPlugins/Sidebar/Detached/index.vue.d.ts +8 -4
- package/dist/runtime/blokkliPlugins/Sidebar/index.vue +55 -25
- package/dist/runtime/blokkliPlugins/Sidebar/index.vue.d.ts +5 -4
- package/dist/runtime/blokkliPlugins/ToolbarButton/index.vue +9 -2
- package/dist/runtime/blokkliPlugins/ToolbarButton/index.vue.d.ts +2 -0
- package/dist/runtime/blokkliPlugins/TourItem/index.vue +22 -13
- package/dist/runtime/blokkliPlugins/TourItem/index.vue.d.ts +1 -0
- package/dist/runtime/blokkliPlugins/ViewOption/index.vue +3 -1
- package/dist/runtime/blokkliPlugins/index.d.ts +1 -5
- package/dist/runtime/blokkliPlugins/index.js +0 -8
- package/dist/runtime/components/Blocks/FromLibrary/index.vue +0 -5
- package/dist/runtime/components/BlokkliEditable.vue +6 -1
- package/dist/runtime/components/BlokkliField.vue +1 -1
- package/dist/runtime/components/BlokkliProvider.vue +4 -4
- package/dist/runtime/components/BlokkliProvider.vue.d.ts +1 -1
- package/dist/runtime/components/Edit/Actions/ItemDropdown.vue +66 -0
- package/dist/runtime/components/Edit/Actions/ItemDropdown.vue.d.ts +6 -0
- package/dist/runtime/components/Edit/Actions/index.vue +80 -117
- package/dist/runtime/components/Edit/AddListItem/index.vue +8 -29
- package/dist/runtime/components/Edit/AddListItem/index.vue.d.ts +2 -3
- package/dist/runtime/components/Edit/AnimationCanvas/index.vue +23 -68
- package/dist/runtime/components/Edit/AppMenu/MenuButton.vue +39 -0
- package/dist/runtime/{blokkliPlugins/MenuButton/index.vue.d.ts → components/Edit/AppMenu/MenuButton.vue.d.ts} +0 -4
- package/dist/runtime/components/Edit/AppMenu/index.vue +62 -40
- package/dist/runtime/components/Edit/BlockProxy/index.vue +2 -8
- package/dist/runtime/components/Edit/BlokkliErrorBoundary.vue +33 -49
- package/dist/runtime/components/Edit/BlokkliErrorBoundary.vue.d.ts +14 -1
- package/dist/runtime/components/Edit/BlokkliRootErrorBoundary.vue +93 -0
- package/dist/runtime/components/Edit/BlokkliRootErrorBoundary.vue.d.ts +12 -0
- package/dist/runtime/components/Edit/Dialog/index.vue +26 -5
- package/dist/runtime/components/Edit/Dialog/index.vue.d.ts +2 -0
- package/dist/runtime/components/Edit/DraggableList.vue +5 -25
- package/dist/runtime/components/Edit/EditProvider.vue +71 -41
- package/dist/runtime/components/Edit/EditProvider.vue.d.ts +1 -1
- package/dist/runtime/components/Edit/Features/AddList/Actions/Action.vue +52 -0
- package/dist/runtime/components/Edit/Features/AddList/Actions/Action.vue.d.ts +7 -0
- package/dist/runtime/components/Edit/Features/AddList/Actions/index.vue +41 -0
- package/dist/runtime/components/Edit/Features/{Selection/OverlayFallback → AddList/Actions}/index.vue.d.ts +1 -1
- package/dist/runtime/components/Edit/Features/{BlockAddList → AddList/Blocks}/index.vue +36 -108
- package/dist/runtime/components/Edit/Features/{Hover/Overlay → AddList/Blocks}/index.vue.d.ts +7 -2
- package/dist/runtime/components/Edit/Features/AddList/index.vue +76 -110
- package/dist/runtime/components/Edit/Features/Analyze/{Renderer.vue → Main.vue} +4 -8
- package/dist/runtime/components/Edit/Features/Analyze/{Overlay → Renderer}/fragment.glsl +10 -6
- package/dist/runtime/components/Edit/Features/Analyze/{Overlay → Renderer}/index.vue +43 -15
- package/dist/runtime/components/Edit/Features/Analyze/{Overlay → Renderer}/index.vue.d.ts +0 -2
- package/dist/runtime/components/Edit/Features/Analyze/{Overlay → Renderer}/vertex.glsl +11 -9
- package/dist/runtime/components/Edit/Features/Analyze/Results/ResultsItemNodesTarget.vue +15 -3
- package/dist/runtime/components/Edit/Features/Analyze/index.vue +7 -3
- package/dist/runtime/components/Edit/Features/Anchors/index.vue +2 -2
- package/dist/runtime/components/Edit/Features/Artboard/Renderer.vue +41 -20
- package/dist/runtime/components/Edit/Features/Artboard/Scrollbar/index.vue +3 -2
- package/dist/runtime/components/Edit/Features/Assistant/Overlay/index.vue +2 -28
- package/dist/runtime/components/Edit/Features/Assistant/index.vue +18 -14
- package/dist/runtime/components/Edit/Features/BlockScheduler/Dialog/index.vue +1 -0
- package/dist/runtime/components/Edit/Features/BlockScheduler/index.vue +2 -2
- package/dist/runtime/components/Edit/Features/Clipboard/List/index.vue +22 -11
- package/dist/runtime/components/Edit/Features/Clipboard/index.vue +70 -29
- package/dist/runtime/components/Edit/Features/CommandPalette/Palette/Item/index.vue +0 -2
- package/dist/runtime/components/Edit/Features/CommandPalette/Palette/Item/index.vue.d.ts +6 -4
- package/dist/runtime/components/Edit/Features/CommandPalette/Palette/index.vue +77 -27
- package/dist/runtime/components/Edit/Features/CommandPalette/index.vue +7 -4
- package/dist/runtime/components/Edit/Features/Comments/index.vue +2 -2
- package/dist/runtime/components/Edit/Features/Conversions/index.vue +16 -9
- package/dist/runtime/components/Edit/Features/Debug/DebugSection.vue +24 -0
- package/dist/runtime/components/Edit/Features/Debug/DebugSection.vue.d.ts +16 -0
- package/dist/runtime/components/Edit/Features/Debug/Main.vue +80 -0
- package/dist/runtime/components/Edit/Features/Debug/Section/Features.vue +34 -0
- package/dist/runtime/components/Edit/Features/Debug/Section/Icons.vue +15 -0
- package/dist/runtime/components/Edit/Features/Debug/Section/Icons.vue.d.ts +2 -0
- package/dist/runtime/components/Edit/Features/Debug/Section/Keyboard.vue +17 -0
- package/dist/runtime/components/Edit/Features/Debug/Section/Keyboard.vue.d.ts +2 -0
- package/dist/runtime/components/Edit/Features/Debug/Section/Logging.vue +66 -0
- package/dist/runtime/components/Edit/Features/Debug/Section/Logging.vue.d.ts +6 -0
- package/dist/runtime/components/Edit/Features/Debug/Section/Rendering.vue +96 -0
- package/dist/runtime/components/Edit/Features/Debug/Section/Rendering.vue.d.ts +2 -0
- package/dist/runtime/components/Edit/Features/Debug/Section/Selection.vue +25 -0
- package/dist/runtime/components/Edit/Features/Debug/Section/Selection.vue.d.ts +2 -0
- package/dist/runtime/components/Edit/Features/Debug/index.vue +2 -2
- package/dist/runtime/components/Edit/Features/DraggingOverlay/DragItems/DragItem.vue +113 -0
- package/dist/runtime/components/Edit/Features/DraggingOverlay/DragItems/DragItem.vue.d.ts +25 -0
- package/dist/runtime/components/Edit/Features/DraggingOverlay/DragItems/index.vue +23 -119
- package/dist/runtime/components/Edit/Features/DraggingOverlay/Renderer/fragment.glsl +77 -0
- package/dist/runtime/components/Edit/Features/DraggingOverlay/{DropTargets → Renderer}/index.vue +138 -92
- package/dist/runtime/components/Edit/Features/DraggingOverlay/{DropTargets → Renderer}/vertex.glsl +60 -8
- package/dist/runtime/components/Edit/Features/DraggingOverlay/index.vue +4 -5
- package/dist/runtime/components/Edit/Features/EditForm/index.vue +2 -2
- package/dist/runtime/components/Edit/Features/EditableField/Overlay/index.vue +0 -6
- package/dist/runtime/components/Edit/Features/EditableField/index.vue +8 -4
- package/dist/runtime/components/Edit/Features/Exit/index.vue +12 -9
- package/dist/runtime/components/Edit/Features/Fragments/Dialog/Item/index.vue +1 -5
- package/dist/runtime/components/Edit/Features/Fragments/index.vue +27 -31
- package/dist/runtime/components/Edit/Features/Hover/Renderer/fragment.glsl +141 -0
- package/dist/runtime/components/Edit/Features/Hover/{Overlay → Renderer}/index.vue +225 -38
- package/dist/runtime/components/Edit/Features/Hover/Renderer/index.vue.d.ts +2 -0
- package/dist/runtime/components/Edit/Features/Hover/{Overlay → Renderer}/vertex.glsl +49 -11
- package/dist/runtime/components/Edit/Features/Hover/index.vue +9 -6
- package/dist/runtime/components/Edit/Features/ImportExisting/Dialog/index.vue +1 -0
- package/dist/runtime/components/Edit/Features/ImportExisting/index.vue +25 -24
- package/dist/runtime/components/Edit/Features/Library/EditReusable/index.vue +2 -2
- package/dist/runtime/components/Edit/Features/Library/LibraryDialog/Item/index.vue +1 -5
- package/dist/runtime/components/Edit/Features/Library/ReusableDialog/index.vue +1 -0
- package/dist/runtime/components/Edit/Features/Library/index.vue +50 -36
- package/dist/runtime/components/Edit/Features/MediaLibrary/Library/Item.vue +1 -1
- package/dist/runtime/components/Edit/Features/MediaLibrary/Library/index.vue +26 -13
- package/dist/runtime/components/Edit/Features/MediaLibrary/Library/index.vue.d.ts +0 -1
- package/dist/runtime/components/Edit/Features/MediaLibrary/index.vue +3 -47
- package/dist/runtime/components/Edit/Features/MultiSelect/{Overlay → Renderer}/fragment.glsl +13 -26
- package/dist/runtime/components/Edit/Features/MultiSelect/{Overlay → Renderer}/index.vue +131 -75
- package/dist/runtime/components/Edit/Features/MultiSelect/{Overlay → Renderer}/index.vue.d.ts +0 -1
- package/dist/runtime/components/Edit/Features/MultiSelect/{Overlay → Renderer}/vertex.glsl +27 -2
- package/dist/runtime/components/Edit/Features/MultiSelect/index.vue +25 -12
- package/dist/runtime/components/Edit/Features/Ownership/index.vue +2 -2
- package/dist/runtime/components/Edit/Features/PreviewGrant/index.vue +2 -1
- package/dist/runtime/components/Edit/Features/Publish/Dialog/index.vue +1 -0
- package/dist/runtime/components/Edit/Features/Publish/index.vue +17 -15
- package/dist/runtime/components/Edit/Features/ResponsivePreview/index.vue +1 -1
- package/dist/runtime/components/Edit/Features/Revert/index.vue +24 -18
- package/dist/runtime/components/Edit/Features/Search/Overlay/Results/Content/index.vue +23 -6
- package/dist/runtime/components/Edit/Features/Search/index.vue +1 -1
- package/dist/runtime/components/Edit/Features/Selection/AddButtons/Overlay/index.vue +21 -17
- package/dist/runtime/components/Edit/Features/Selection/AddButtons/Overlay/index.vue.d.ts +6 -6
- package/dist/runtime/components/Edit/Features/Selection/AddButtons/Renderer/fragment.glsl +19 -17
- package/dist/runtime/components/Edit/Features/Selection/AddButtons/Renderer/index.vue +242 -131
- package/dist/runtime/components/Edit/Features/Selection/AddButtons/Renderer/vertex.glsl +29 -12
- package/dist/runtime/components/Edit/Features/Selection/AddButtons/index.vue +15 -10
- package/dist/runtime/components/Edit/Features/Selection/{Overlay → Renderer}/fragment.glsl +23 -14
- package/dist/runtime/components/Edit/Features/Selection/{Overlay → Renderer}/index.vue +121 -28
- package/dist/runtime/components/Edit/Features/Selection/{Overlay → Renderer}/index.vue.d.ts +0 -2
- package/dist/runtime/components/Edit/Features/Selection/{Overlay → Renderer}/vertex.glsl +23 -14
- package/dist/runtime/components/Edit/Features/Selection/index.vue +46 -59
- package/dist/runtime/components/Edit/Features/Settings/Dialog/index.vue +1 -0
- package/dist/runtime/components/Edit/Features/Settings/index.vue +25 -17
- package/dist/runtime/components/Edit/Features/TouchActionBar/index.vue +2 -2
- package/dist/runtime/components/Edit/Features/Tour/Overlay/index.vue +1 -1
- package/dist/runtime/components/Edit/Features/Tour/Popup/index.vue +2 -2
- package/dist/runtime/components/Edit/Features/Tour/index.vue +12 -10
- package/dist/runtime/components/Edit/Features/Transform/Dialog/index.vue +5 -5
- package/dist/runtime/components/Edit/Features/Transform/index.vue +30 -23
- package/dist/runtime/components/Edit/Features/Translations/index.vue +18 -17
- package/dist/runtime/components/Edit/Form/Checkboxes/index.vue +43 -0
- package/dist/runtime/components/Edit/Form/Checkboxes/index.vue.d.ts +20 -0
- package/dist/runtime/components/Edit/FormOverlay/index.vue +13 -4
- package/dist/runtime/components/Edit/ItemIconBox/index.vue +41 -0
- package/dist/runtime/components/Edit/{AddListItemIcon → ItemIconBox}/index.vue.d.ts +5 -5
- package/dist/runtime/components/Edit/Konami/Game/index.vue +0 -1
- package/dist/runtime/components/Edit/Konami/index.vue +3 -5
- package/dist/runtime/components/Edit/Messages/Item/index.vue +11 -2
- package/dist/runtime/components/Edit/Messages/Item/index.vue.d.ts +1 -1
- package/dist/runtime/components/Edit/Messages/index.vue +6 -1
- package/dist/runtime/components/Edit/Overlay/index.vue +66 -0
- package/dist/runtime/components/Edit/Overlay/index.vue.d.ts +2 -0
- package/dist/runtime/components/Edit/PreviewProvider.vue +1 -1
- package/dist/runtime/components/Edit/Sortli/index.vue +5 -8
- package/dist/runtime/components/Edit/Sortli/index.vue.d.ts +2 -0
- package/dist/runtime/components/Edit/SystemRequirements/index.vue +36 -36
- package/dist/runtime/components/Edit/Toolbar/index.vue +47 -51
- package/dist/runtime/components/Edit/ViewportBlockingRect/index.vue +9 -2
- package/dist/runtime/components/Edit/ViewportBlockingRect/index.vue.d.ts +4 -1
- package/dist/runtime/components/Edit/index.d.ts +7 -5
- package/dist/runtime/components/Edit/index.js +13 -9
- package/dist/runtime/css/output.css +1 -1
- package/dist/runtime/helpers/animationProvider.d.ts +58 -9
- package/dist/runtime/helpers/animationProvider.js +318 -75
- package/dist/runtime/helpers/composables/defineAddAction.d.ts +2 -0
- package/dist/runtime/helpers/composables/defineAddAction.js +10 -0
- package/dist/runtime/helpers/composables/defineItemDropdownAction.d.ts +2 -0
- package/dist/runtime/helpers/composables/defineItemDropdownAction.js +10 -0
- package/dist/runtime/helpers/composables/defineMenuButton.d.ts +2 -0
- package/dist/runtime/helpers/composables/defineMenuButton.js +10 -0
- package/dist/runtime/helpers/composables/defineRenderer.d.ts +5 -2
- package/dist/runtime/helpers/composables/defineRenderer.js +3 -2
- package/dist/runtime/helpers/composables/useDialog.d.ts +3 -0
- package/dist/runtime/helpers/composables/useDialog.js +16 -0
- package/dist/runtime/helpers/composables/useGlobalBlokkliObject.d.ts +16 -0
- package/dist/runtime/helpers/composables/useGlobalBlokkliObject.js +36 -0
- package/dist/runtime/helpers/debugProvider.d.ts +13 -3
- package/dist/runtime/helpers/debugProvider.js +80 -12
- package/dist/runtime/helpers/defineElementStyle.d.ts +2 -0
- package/dist/runtime/helpers/defineElementStyle.js +33 -0
- package/dist/runtime/helpers/domProvider.d.ts +1 -0
- package/dist/runtime/helpers/domProvider.js +51 -32
- package/dist/runtime/helpers/dropTargets/index.d.ts +1 -1
- package/dist/runtime/helpers/dropTargets/index.js +18 -4
- package/dist/runtime/helpers/eventBus.d.ts +1 -1
- package/dist/runtime/helpers/index.d.ts +1 -6
- package/dist/runtime/helpers/index.js +0 -81
- package/dist/runtime/helpers/pluginProvider.d.ts +38 -3
- package/dist/runtime/helpers/pluginProvider.js +49 -18
- package/dist/runtime/helpers/providers/blocks.js +10 -0
- package/dist/runtime/helpers/providers/directive.d.ts +4 -1
- package/dist/runtime/helpers/providers/directive.js +9 -2
- package/dist/runtime/helpers/providers/fields.d.ts +9 -1
- package/dist/runtime/helpers/stateProvider.js +1 -0
- package/dist/runtime/helpers/uiProvider.d.ts +13 -12
- package/dist/runtime/helpers/uiProvider.js +117 -81
- package/dist/runtime/helpers/webgl/index.d.ts +2 -3
- package/dist/runtime/helpers/webgl/index.js +9 -14
- package/dist/runtime/icons/click.svg +1 -0
- package/dist/runtime/icons/dock-left.svg +1 -0
- package/dist/runtime/icons/dock-right.svg +1 -0
- package/dist/runtime/icons/dock-window.svg +1 -0
- package/dist/runtime/plugins/blokkliDirectives.js +1 -1
- package/dist/runtime/types/index.d.ts +16 -26
- package/package.json +1 -1
- package/dist/runtime/blokkliPlugins/AddAction/index.vue +0 -96
- package/dist/runtime/blokkliPlugins/AddAction/index.vue.d.ts +0 -26
- package/dist/runtime/blokkliPlugins/DroppableEdit/index.vue +0 -56
- package/dist/runtime/blokkliPlugins/DroppableEdit/index.vue.d.ts +0 -24
- package/dist/runtime/blokkliPlugins/ItemDropdown/index.vue +0 -76
- package/dist/runtime/blokkliPlugins/ItemDropdown/index.vue.d.ts +0 -31
- package/dist/runtime/blokkliPlugins/MenuButton/index.vue +0 -66
- package/dist/runtime/components/Edit/AddListItemIcon/index.vue +0 -19
- package/dist/runtime/components/Edit/Features/BlockAddList/docs.md +0 -15
- package/dist/runtime/components/Edit/Features/Debug/Renderer.vue +0 -240
- package/dist/runtime/components/Edit/Features/DraggingOverlay/DropTargets/fragment.glsl +0 -96
- package/dist/runtime/components/Edit/Features/Hover/Overlay/fragment.glsl +0 -139
- package/dist/runtime/components/Edit/Features/Selection/OverlayFallback/index.vue +0 -42
- /package/dist/runtime/components/Edit/Features/Analyze/{Renderer.vue.d.ts → Main.vue.d.ts} +0 -0
- /package/dist/runtime/components/Edit/Features/Anchors/{Renderer.vue → Overlay/index.vue} +0 -0
- /package/dist/runtime/components/Edit/Features/{BlockAddList → Anchors/Overlay}/index.vue.d.ts +0 -0
- /package/dist/runtime/components/Edit/Features/Debug/{Renderer.vue.d.ts → Main.vue.d.ts} +0 -0
- /package/dist/runtime/components/Edit/Features/{Anchors/Renderer.vue.d.ts → Debug/Section/Features.vue.d.ts} +0 -0
- /package/dist/runtime/components/Edit/Features/DraggingOverlay/{DropTargets → Renderer}/index.vue.d.ts +0 -0
- /package/dist/runtime/components/Edit/Features/Ownership/{Renderer.vue → Banner/index.vue} +0 -0
- /package/dist/runtime/components/Edit/Features/Ownership/{Renderer.vue.d.ts → Banner/index.vue.d.ts} +0 -0
|
@@ -16,11 +16,9 @@ import fs from "./fragment.glsl?raw";
|
|
|
16
16
|
import { RectangleBufferCollector } from "#blokkli/helpers/webgl";
|
|
17
17
|
import { toShaderColor } from "#blokkli/helpers";
|
|
18
18
|
const props = defineProps({
|
|
19
|
-
results: { type: Array, required: true }
|
|
20
|
-
gl: { type: null, required: true }
|
|
19
|
+
results: { type: Array, required: true }
|
|
21
20
|
});
|
|
22
21
|
const { animation, ui, theme, selection, eventBus, element } = useBlokkli();
|
|
23
|
-
const programInfo = animation.registerProgram("analyze", props.gl, [vs, fs]);
|
|
24
22
|
const statusPriority = {
|
|
25
23
|
violation: 3,
|
|
26
24
|
incomplete: 2,
|
|
@@ -66,7 +64,7 @@ class AnalyzeRectangleBufferCollector extends RectangleBufferCollector {
|
|
|
66
64
|
clearCache() {
|
|
67
65
|
this.rectCache.clear();
|
|
68
66
|
}
|
|
69
|
-
getBufferInfo(force) {
|
|
67
|
+
getBufferInfo(gl, force) {
|
|
70
68
|
const key = nodes.value.map((node, index) => {
|
|
71
69
|
if (!this.rectCache.has(node.element)) {
|
|
72
70
|
this.rectCache.set(
|
|
@@ -109,30 +107,60 @@ class AnalyzeRectangleBufferCollector extends RectangleBufferCollector {
|
|
|
109
107
|
}
|
|
110
108
|
this.prevKey = key;
|
|
111
109
|
}
|
|
112
|
-
if (hasChanged) {
|
|
113
|
-
this.bufferInfo = this.createBufferInfo();
|
|
110
|
+
if (hasChanged && gl) {
|
|
111
|
+
this.bufferInfo = this.createBufferInfo(gl);
|
|
114
112
|
}
|
|
115
113
|
return { info: this.bufferInfo, hasChanged };
|
|
116
114
|
}
|
|
117
115
|
}
|
|
118
|
-
const collector =
|
|
119
|
-
defineRenderer("analyze-overlay", {
|
|
116
|
+
const { collector } = defineRenderer("analyze-overlay", {
|
|
120
117
|
zIndex: 500,
|
|
118
|
+
collector: () => new AnalyzeRectangleBufferCollector(),
|
|
119
|
+
program: () => ({ shaders: [vs, fs] }),
|
|
121
120
|
enabled: () => !selection.isMultiSelecting.value && !selection.isDragging.value,
|
|
122
|
-
render: (
|
|
123
|
-
|
|
124
|
-
const { info } = collector.getBufferInfo();
|
|
121
|
+
render: (_ctx, gl, program) => {
|
|
122
|
+
gl.useProgram(program.program);
|
|
123
|
+
const { info } = collector.getBufferInfo(gl);
|
|
125
124
|
if (!info) {
|
|
126
125
|
return;
|
|
127
126
|
}
|
|
128
|
-
setUniforms(
|
|
127
|
+
setUniforms(program, {
|
|
129
128
|
u_color_violation: toShaderColor(theme.red.value.normal),
|
|
130
129
|
u_color_incomplete: toShaderColor(theme.yellow.value.normal),
|
|
131
130
|
u_color_pass: toShaderColor(theme.lime.value.normal)
|
|
132
131
|
});
|
|
133
|
-
animation.setSharedUniforms(
|
|
134
|
-
setBuffersAndAttributes(
|
|
135
|
-
drawBufferInfo(
|
|
132
|
+
animation.setSharedUniforms(gl, program);
|
|
133
|
+
setBuffersAndAttributes(gl, program, info);
|
|
134
|
+
drawBufferInfo(gl, info, gl.TRIANGLES);
|
|
135
|
+
},
|
|
136
|
+
renderFallback: (ctx, ctx2d) => {
|
|
137
|
+
collector.getBufferInfo();
|
|
138
|
+
const rects = Object.values(collector.rects);
|
|
139
|
+
if (rects.length === 0) {
|
|
140
|
+
return;
|
|
141
|
+
}
|
|
142
|
+
const rgbaToCss = (rgb, alpha) => {
|
|
143
|
+
return `rgba(${rgb[0]}, ${rgb[1]}, ${rgb[2]}, ${alpha})`;
|
|
144
|
+
};
|
|
145
|
+
const colorViolation = rgbaToCss(theme.red.value.normal, 0.3);
|
|
146
|
+
const colorIncomplete = rgbaToCss(theme.yellow.value.normal, 0.3);
|
|
147
|
+
const colorPass = rgbaToCss(theme.lime.value.normal, 0.3);
|
|
148
|
+
for (let i = 0; i < rects.length; i++) {
|
|
149
|
+
const rect = rects[i];
|
|
150
|
+
let fillColor = colorPass;
|
|
151
|
+
if (rect.status === "violation") {
|
|
152
|
+
fillColor = colorViolation;
|
|
153
|
+
} else if (rect.status === "incomplete") {
|
|
154
|
+
fillColor = colorIncomplete;
|
|
155
|
+
}
|
|
156
|
+
ctx2d.fillStyle = fillColor;
|
|
157
|
+
ctx2d.fillRect(
|
|
158
|
+
(rect.x * ctx.artboardScale + ctx.artboardOffset.x) * ctx.dpi,
|
|
159
|
+
(rect.y * ctx.artboardScale + ctx.artboardOffset.y) * ctx.dpi,
|
|
160
|
+
rect.width * ctx.artboardScale * ctx.dpi,
|
|
161
|
+
rect.height * ctx.artboardScale * ctx.dpi
|
|
162
|
+
);
|
|
163
|
+
}
|
|
136
164
|
}
|
|
137
165
|
});
|
|
138
166
|
onBlokkliEvent("ui:resized", function() {
|
|
@@ -1,9 +1,7 @@
|
|
|
1
1
|
import type { AnalyzeResultMapped } from '#blokkli/analyzer/types';
|
|
2
2
|
declare const _default: import("vue").DefineComponent<{
|
|
3
3
|
results: AnalyzeResultMapped[];
|
|
4
|
-
gl: WebGLRenderingContext;
|
|
5
4
|
}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{
|
|
6
5
|
results: AnalyzeResultMapped[];
|
|
7
|
-
gl: WebGLRenderingContext;
|
|
8
6
|
}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
9
7
|
export default _default;
|
|
@@ -1,11 +1,13 @@
|
|
|
1
|
+
#version 300 es
|
|
2
|
+
|
|
1
3
|
precision highp float;
|
|
2
4
|
|
|
3
5
|
// [x, y] position.
|
|
4
|
-
|
|
6
|
+
in vec2 a_position;
|
|
5
7
|
// The [x,y,width, height] of the quad the vertex belongs to.
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
8
|
+
in vec4 a_quad;
|
|
9
|
+
in float a_rect_id;
|
|
10
|
+
in float a_rect_type;
|
|
9
11
|
|
|
10
12
|
// The global scaling applied to all quads.
|
|
11
13
|
uniform float u_scale;
|
|
@@ -19,11 +21,11 @@ uniform vec3 u_color_violation;
|
|
|
19
21
|
uniform vec3 u_color_incomplete;
|
|
20
22
|
uniform vec3 u_color_pass;
|
|
21
23
|
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
24
|
+
out vec4 v_quad;
|
|
25
|
+
out float v_rect_type;
|
|
26
|
+
out vec3 v_color;
|
|
27
|
+
out vec2 v_rect_size;
|
|
28
|
+
out vec2 v_rect_center;
|
|
27
29
|
|
|
28
30
|
void main() {
|
|
29
31
|
// Apply global scale and offsets
|
|
@@ -46,21 +46,33 @@ function getElement() {
|
|
|
46
46
|
}
|
|
47
47
|
return null;
|
|
48
48
|
}
|
|
49
|
+
function getElementLabel(tagName) {
|
|
50
|
+
return `<${tagName.toLowerCase()}>`;
|
|
51
|
+
}
|
|
49
52
|
function getLabel() {
|
|
50
53
|
if (props.target) {
|
|
51
54
|
if (typeof props.target === "string") {
|
|
52
55
|
return props.target;
|
|
53
56
|
} else if (props.target instanceof HTMLElement) {
|
|
54
|
-
|
|
57
|
+
if (props.target instanceof HTMLImageElement) {
|
|
58
|
+
if (props.target.alt) {
|
|
59
|
+
return props.target.alt.slice(0, 50);
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
const textContent = (props.target.textContent ?? "").slice(0, 50);
|
|
63
|
+
if (textContent) {
|
|
64
|
+
return textContent;
|
|
65
|
+
}
|
|
66
|
+
return getElementLabel(props.target.tagName);
|
|
55
67
|
} else if (typeof props.target === "object" && "uuid" in props.target) {
|
|
56
68
|
return props.target.uuid;
|
|
57
69
|
}
|
|
58
70
|
}
|
|
59
71
|
}
|
|
60
72
|
function findClosestUuid(element2) {
|
|
61
|
-
const closestBlock = element2.closest("[data-uuid]");
|
|
73
|
+
const closestBlock = element2.closest("[data-bk-uuid]");
|
|
62
74
|
if (closestBlock instanceof HTMLElement) {
|
|
63
|
-
const uuid = closestBlock.dataset.
|
|
75
|
+
const uuid = closestBlock.dataset.bkUuid;
|
|
64
76
|
if (uuid) {
|
|
65
77
|
return uuid;
|
|
66
78
|
}
|
|
@@ -5,14 +5,18 @@
|
|
|
5
5
|
:tour-text="$t('analyzeTourText', 'Analyze the content of your page')"
|
|
6
6
|
icon="speedometer"
|
|
7
7
|
>
|
|
8
|
-
<
|
|
8
|
+
<AnalyzerMain
|
|
9
|
+
:key="animation.renderKey.value"
|
|
10
|
+
:langcode="context.language"
|
|
11
|
+
:analyzers
|
|
12
|
+
/>
|
|
9
13
|
</PluginSidebar>
|
|
10
14
|
</template>
|
|
11
15
|
|
|
12
16
|
<script setup>
|
|
13
17
|
import { useBlokkli, defineBlokkliFeature } from "#imports";
|
|
14
18
|
import { PluginSidebar } from "#blokkli/plugins";
|
|
15
|
-
import
|
|
19
|
+
import AnalyzerMain from "./Main.vue";
|
|
16
20
|
const { adapter } = defineBlokkliFeature({
|
|
17
21
|
id: "analyze",
|
|
18
22
|
label: "Analyze",
|
|
@@ -34,7 +38,7 @@ function getAdapterAnalyzers() {
|
|
|
34
38
|
});
|
|
35
39
|
}
|
|
36
40
|
const analyzers = await getAdapterAnalyzers();
|
|
37
|
-
const { $t, context } = useBlokkli();
|
|
41
|
+
const { $t, context, animation } = useBlokkli();
|
|
38
42
|
</script>
|
|
39
43
|
|
|
40
44
|
<script>
|
|
@@ -7,14 +7,14 @@
|
|
|
7
7
|
:title-off="$t('anchorHide', 'Hide anchor links')"
|
|
8
8
|
icon="anchor"
|
|
9
9
|
>
|
|
10
|
-
<
|
|
10
|
+
<AnchorOverlay v-if="isActive" />
|
|
11
11
|
</PluginViewOption>
|
|
12
12
|
</template>
|
|
13
13
|
|
|
14
14
|
<script setup>
|
|
15
15
|
import { useBlokkli, defineBlokkliFeature } from "#imports";
|
|
16
16
|
import { PluginViewOption } from "#blokkli/plugins";
|
|
17
|
-
import
|
|
17
|
+
import AnchorOverlay from "./Overlay/index.vue";
|
|
18
18
|
defineBlokkliFeature({
|
|
19
19
|
id: "anchors",
|
|
20
20
|
label: "Anchors",
|
|
@@ -38,7 +38,10 @@
|
|
|
38
38
|
key-code="O"
|
|
39
39
|
weight="90"
|
|
40
40
|
>
|
|
41
|
-
<Teleport
|
|
41
|
+
<Teleport
|
|
42
|
+
v-if="isActive && dom.isReady.value"
|
|
43
|
+
:to="ui.mainLayoutElement.value"
|
|
44
|
+
>
|
|
42
45
|
<Overview :artboard="artboard" />
|
|
43
46
|
</Teleport>
|
|
44
47
|
</PluginViewOption>
|
|
@@ -166,45 +169,63 @@ watch(options, function(newOptions) {
|
|
|
166
169
|
const AUTOSCROLL_EDGE_ZONE = 130;
|
|
167
170
|
const AUTOSCROLL_SPEED = 12;
|
|
168
171
|
let autoScrollSpeed = 1;
|
|
172
|
+
let lastScrollDirection = 0;
|
|
169
173
|
function edgeStep(distance) {
|
|
170
174
|
const ratio = distance / AUTOSCROLL_EDGE_ZONE;
|
|
171
175
|
return Math.pow(ratio, 3) * AUTOSCROLL_SPEED;
|
|
172
176
|
}
|
|
173
177
|
let hasLeftAddList = false;
|
|
178
|
+
let hasLeftEdgeZone = false;
|
|
174
179
|
onBlokkliEvent("dragging:end", () => {
|
|
175
180
|
hasLeftAddList = false;
|
|
181
|
+
hasLeftEdgeZone = false;
|
|
182
|
+
autoScrollSpeed = 1;
|
|
183
|
+
lastScrollDirection = 0;
|
|
176
184
|
});
|
|
177
|
-
|
|
185
|
+
function handleAutoScroll(mouseX, mouseY) {
|
|
178
186
|
if (selection.isDragging.value) {
|
|
179
|
-
if (
|
|
180
|
-
if (
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
return;
|
|
185
|
-
}
|
|
187
|
+
if (!hasLeftAddList) {
|
|
188
|
+
if (isInsideRect(mouseX, mouseY, ui.visibleViewportPadded.value)) {
|
|
189
|
+
hasLeftAddList = true;
|
|
190
|
+
} else {
|
|
191
|
+
return;
|
|
186
192
|
}
|
|
187
193
|
}
|
|
188
|
-
const viewportHeight = ui.
|
|
194
|
+
const viewportHeight = ui.visibleViewport.value.height;
|
|
189
195
|
const currentOffset = artboard.getOffset();
|
|
190
|
-
const y = Math.min(
|
|
196
|
+
const y = Math.min(
|
|
197
|
+
Math.max(mouseY - ui.visibleViewport.value.y, 0),
|
|
198
|
+
viewportHeight
|
|
199
|
+
);
|
|
200
|
+
const isInEdgeZone = y < AUTOSCROLL_EDGE_ZONE || y > viewportHeight - AUTOSCROLL_EDGE_ZONE;
|
|
201
|
+
if (!isInEdgeZone && !hasLeftEdgeZone) {
|
|
202
|
+
hasLeftEdgeZone = true;
|
|
203
|
+
}
|
|
191
204
|
let dy = 0;
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
205
|
+
let currentDirection = 0;
|
|
206
|
+
if (hasLeftEdgeZone && isInEdgeZone) {
|
|
207
|
+
if (y < AUTOSCROLL_EDGE_ZONE) {
|
|
208
|
+
const dist = AUTOSCROLL_EDGE_ZONE - y;
|
|
209
|
+
dy = edgeStep(dist);
|
|
210
|
+
currentDirection = 1;
|
|
211
|
+
} else if (y > viewportHeight - AUTOSCROLL_EDGE_ZONE) {
|
|
212
|
+
const dist = y - (viewportHeight - AUTOSCROLL_EDGE_ZONE);
|
|
213
|
+
dy = -edgeStep(dist);
|
|
214
|
+
currentDirection = -1;
|
|
215
|
+
}
|
|
216
|
+
}
|
|
217
|
+
if (currentDirection !== 0 && currentDirection !== lastScrollDirection) {
|
|
199
218
|
autoScrollSpeed = 1;
|
|
219
|
+
lastScrollDirection = currentDirection;
|
|
200
220
|
}
|
|
201
221
|
if (dy !== 0) {
|
|
202
222
|
artboard.setOffset(null, currentOffset.y + dy * autoScrollSpeed);
|
|
203
223
|
autoScrollSpeed = Math.min(autoScrollSpeed * 1.01, 2.25);
|
|
204
224
|
}
|
|
205
|
-
} else {
|
|
206
|
-
autoScrollSpeed = 1;
|
|
207
225
|
}
|
|
226
|
+
}
|
|
227
|
+
onBlokkliEvent("animationFrame:before", ({ time, mouseY, mouseX }) => {
|
|
228
|
+
handleAutoScroll(mouseX, mouseY);
|
|
208
229
|
artboard.loop(time);
|
|
209
230
|
const artboardSize = artboard.getArtboardSize();
|
|
210
231
|
if (artboardSize) {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<Teleport to="
|
|
2
|
+
<Teleport :to="ui.mainLayoutElement.value" defer>
|
|
3
3
|
<div
|
|
4
4
|
class="bk bk-artboard-scrollbar"
|
|
5
5
|
:class="'bk-orientation-' + orientation"
|
|
@@ -13,11 +13,12 @@
|
|
|
13
13
|
|
|
14
14
|
<script setup>
|
|
15
15
|
import { scrollbar } from "artboard-deluxe";
|
|
16
|
-
import { onBeforeUnmount, onMounted, ref } from "#imports";
|
|
16
|
+
import { onBeforeUnmount, onMounted, ref, useBlokkli } from "#imports";
|
|
17
17
|
const props = defineProps({
|
|
18
18
|
artboard: { type: Object, required: true },
|
|
19
19
|
orientation: { type: String, required: true }
|
|
20
20
|
});
|
|
21
|
+
const { ui } = useBlokkli();
|
|
21
22
|
const el = ref();
|
|
22
23
|
const thumb = ref();
|
|
23
24
|
let scrollbarPlugin = null;
|
|
@@ -68,37 +68,11 @@ import { useBlokkli, ref } from "#imports";
|
|
|
68
68
|
import ResultMarkup from "./ResultMarkup/index.vue";
|
|
69
69
|
const { $t, adapter } = useBlokkli();
|
|
70
70
|
const emit = defineEmits(["close", "submit"]);
|
|
71
|
-
const prompt = ref(
|
|
72
|
-
`Write content for a page talking about VueJS. Please come up with good titles and content for each section.
|
|
73
|
-
|
|
74
|
-
# Origins
|
|
75
|
-
Write about when Vue was created and by whom.
|
|
76
|
-
|
|
77
|
-
# Release of Vue 2
|
|
78
|
-
When was it released, what were the changes.
|
|
79
|
-
|
|
80
|
-
# Release of Vue 3
|
|
81
|
-
Write about the big changes introduced in Vue 3.
|
|
82
|
-
|
|
83
|
-
# Comparison to React
|
|
84
|
-
`
|
|
85
|
-
);
|
|
71
|
+
const prompt = ref("");
|
|
86
72
|
const isGenerating = ref(false);
|
|
87
73
|
const result = ref({
|
|
88
74
|
type: "markup",
|
|
89
|
-
content:
|
|
90
|
-
<h2>Origins</h2>
|
|
91
|
-
<p>Vue was created in 2014 by Evan You, a former Google engineer. It was initially released to the public in February 2014.</p>
|
|
92
|
-
|
|
93
|
-
<h2>Release of Vue 2</h2>
|
|
94
|
-
<p>Vue 2 was released in September 2016. This release introduced significant improvements in performance and the virtual DOM implementation, making Vue even more efficient and capable.</p>
|
|
95
|
-
|
|
96
|
-
<h2>Release of Vue 3</h2>
|
|
97
|
-
<p>Vue 3, released in September 2020, brought several major changes, including the composition API, better TypeScript integration, and significant improvements in terms of performance, tree-shaking, and the overall developer experience.</p>
|
|
98
|
-
|
|
99
|
-
<h2>Comparison to React</h2>
|
|
100
|
-
<p>Vue is often compared to React due to their shared focus on building user interfaces. While React is developed and maintained by Facebook, Vue is an open-source project led by Evan You. Both frameworks have their strengths and weaknesses, and the choice between them often depends on the specific requirements of a project and the preferences of the development team.</p>
|
|
101
|
-
`
|
|
75
|
+
content: ""
|
|
102
76
|
});
|
|
103
77
|
const onSubmit = () => {
|
|
104
78
|
if (!result.value) {
|
|
@@ -1,25 +1,14 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<Teleport to="
|
|
2
|
+
<Teleport :to="ui.mainLayoutElement.value">
|
|
3
3
|
<BlokkliTransition name="slide-in">
|
|
4
4
|
<Overlay v-if="placedAction" @close="onClose" @submit="onSubmit" />
|
|
5
5
|
</BlokkliTransition>
|
|
6
6
|
</Teleport>
|
|
7
|
-
|
|
8
|
-
<PluginAddAction
|
|
9
|
-
type="assistant"
|
|
10
|
-
:title="$t('assistantAddAction', 'Add with AI Assistant')"
|
|
11
|
-
:description="
|
|
12
|
-
$t('assistantAddActionDescription', 'Add content using an AI assistant.')
|
|
13
|
-
"
|
|
14
|
-
icon="robot"
|
|
15
|
-
color="rose"
|
|
16
|
-
@placed="placedAction = $event"
|
|
17
|
-
/>
|
|
18
7
|
</template>
|
|
19
8
|
|
|
20
9
|
<script setup>
|
|
21
10
|
import { useBlokkli, defineBlokkliFeature, ref } from "#imports";
|
|
22
|
-
import
|
|
11
|
+
import defineAddAction from "#blokkli/helpers/composables/defineAddAction";
|
|
23
12
|
import { BlokkliTransition } from "#blokkli/components";
|
|
24
13
|
import Overlay from "./Overlay/index.vue";
|
|
25
14
|
const { adapter } = defineBlokkliFeature({
|
|
@@ -34,7 +23,7 @@ const { adapter } = defineBlokkliFeature({
|
|
|
34
23
|
screenshot: "feature-assistant.jpg",
|
|
35
24
|
dependencies: ["add-list"]
|
|
36
25
|
});
|
|
37
|
-
const { state, $t } = useBlokkli();
|
|
26
|
+
const { state, $t, ui } = useBlokkli();
|
|
38
27
|
const placedAction = ref(null);
|
|
39
28
|
const onClose = () => {
|
|
40
29
|
placedAction.value = null;
|
|
@@ -52,6 +41,21 @@ const onSubmit = async (result) => {
|
|
|
52
41
|
}
|
|
53
42
|
onClose();
|
|
54
43
|
};
|
|
44
|
+
defineAddAction(() => {
|
|
45
|
+
return {
|
|
46
|
+
id: "assistant",
|
|
47
|
+
title: $t("assistantAddAction", "Add with AI Assistant"),
|
|
48
|
+
description: $t(
|
|
49
|
+
"assistantAddActionDescription",
|
|
50
|
+
"Add content using an AI assistant."
|
|
51
|
+
),
|
|
52
|
+
icon: "robot",
|
|
53
|
+
color: "rose",
|
|
54
|
+
callback: (data) => {
|
|
55
|
+
placedAction.value = data;
|
|
56
|
+
}
|
|
57
|
+
};
|
|
58
|
+
});
|
|
55
59
|
</script>
|
|
56
60
|
|
|
57
61
|
<script>
|
|
@@ -23,7 +23,7 @@
|
|
|
23
23
|
</div>
|
|
24
24
|
</template>
|
|
25
25
|
</PluginItemAction>
|
|
26
|
-
<Teleport to="
|
|
26
|
+
<Teleport :to="ui.mainLayoutElement.value">
|
|
27
27
|
<BlokkliTransition name="slide-up">
|
|
28
28
|
<SchedulerDialog
|
|
29
29
|
v-if="isVisible"
|
|
@@ -48,7 +48,7 @@ defineBlokkliFeature({
|
|
|
48
48
|
description: "Adds support for scheduling blocks.",
|
|
49
49
|
requiredAdapterMethods: ["setBlockScheduleDate"]
|
|
50
50
|
});
|
|
51
|
-
const { $t, state, selection, types } = useBlokkli();
|
|
51
|
+
const { $t, state, selection, types, ui } = useBlokkli();
|
|
52
52
|
const bundlesWithPublish = computed(
|
|
53
53
|
() => types.generallyAvailableBundles.filter((v) => v.hasPublishOn).map((v) => v.id)
|
|
54
54
|
);
|
|
@@ -1,16 +1,10 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<Sortli class="bk-clipboard-list">
|
|
2
|
+
<Sortli class="bk-clipboard-list" :build-item>
|
|
3
3
|
<div
|
|
4
4
|
v-for="(item, index) in items"
|
|
5
5
|
:key="index + item.data + renderKey"
|
|
6
|
-
class="bk-parent bk-sidebar-padding"
|
|
7
|
-
data-
|
|
8
|
-
:data-sortli-id="'clipboard_' + index"
|
|
9
|
-
:data-item-bundle="item.itemBundle"
|
|
10
|
-
:data-clipboard-type="item.type"
|
|
11
|
-
:data-clipboard-id="item.id"
|
|
12
|
-
:data-clipboard-data="item.data"
|
|
13
|
-
:data-clipboard-additional="item.additional"
|
|
6
|
+
class="bk-parent bk-sidebar-padding bk-clipboard-list-item"
|
|
7
|
+
:data-sortli-id="index"
|
|
14
8
|
>
|
|
15
9
|
<div class="bk-clipboard-item">
|
|
16
10
|
<div class="bk bk-clipboard-item-header">
|
|
@@ -24,7 +18,7 @@
|
|
|
24
18
|
<Icon name="delete" />
|
|
25
19
|
</button>
|
|
26
20
|
</div>
|
|
27
|
-
<div
|
|
21
|
+
<div>
|
|
28
22
|
<div
|
|
29
23
|
v-if="item.type === 'text'"
|
|
30
24
|
class="bk-clipboard-item-inner"
|
|
@@ -50,7 +44,7 @@ import { ItemIcon, Icon, Sortli } from "#blokkli/components";
|
|
|
50
44
|
import ClipboardItemVideo from "./Item/Video.vue";
|
|
51
45
|
import ClipboardItemFile from "./Item/File.vue";
|
|
52
46
|
const renderKey = ref(0);
|
|
53
|
-
defineProps({
|
|
47
|
+
const props = defineProps({
|
|
54
48
|
items: { type: Array, required: true }
|
|
55
49
|
});
|
|
56
50
|
defineEmits(["remove"]);
|
|
@@ -58,4 +52,21 @@ const { types } = useBlokkli();
|
|
|
58
52
|
function getLabel(bundle) {
|
|
59
53
|
return types.getBlockBundleDefinition(bundle)?.label || bundle;
|
|
60
54
|
}
|
|
55
|
+
function buildItem(element) {
|
|
56
|
+
if (!element.dataset.sortliId) {
|
|
57
|
+
return;
|
|
58
|
+
}
|
|
59
|
+
const index = Number.parseInt(element.dataset.sortliId);
|
|
60
|
+
const item = props.items[index];
|
|
61
|
+
if (!item) {
|
|
62
|
+
return;
|
|
63
|
+
}
|
|
64
|
+
return {
|
|
65
|
+
itemType: "clipboard",
|
|
66
|
+
element: () => element,
|
|
67
|
+
itemBundle: item.itemBundle,
|
|
68
|
+
additional: item.additional,
|
|
69
|
+
clipboardId: item.id
|
|
70
|
+
};
|
|
71
|
+
}
|
|
61
72
|
</script>
|