@blokkli/editor 2.0.0-alpha.63 → 2.0.0-alpha.64
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/global/types/blockOptions.d.ts +32 -27
- package/dist/module.d.mts +2 -2
- package/dist/module.json +1 -1
- package/dist/module.mjs +108 -5
- package/dist/modules/agent/index.d.mts +1 -1
- package/dist/modules/agent/index.mjs +2 -1
- package/dist/modules/agent/runtime/app/components/Attachment/PreviewCsv/index.vue +1 -1
- package/dist/modules/agent/runtime/app/features/agent/ConversationsAdmin/SplitView/index.d.vue.ts +1 -1
- package/dist/modules/agent/runtime/app/features/agent/ConversationsAdmin/SplitView/index.vue.d.ts +1 -1
- package/dist/modules/agent/runtime/app/features/agent/Panel/Input/Actions/index.vue +1 -1
- package/dist/modules/agent/runtime/app/features/agent/Panel/Welcome/index.vue +1 -1
- package/dist/modules/agent/runtime/app/features/agent/Transcript/index.vue +1 -1
- package/dist/modules/agent/runtime/app/features/agent/index.vue +1 -1
- package/dist/modules/agent/runtime/app/tools/add_content_search_paragraphs/index.d.ts +1 -1
- package/dist/modules/agent/runtime/app/tools/add_fragment/index.d.ts +1 -1
- package/dist/modules/agent/runtime/app/tools/add_media_paragraph/index.d.ts +1 -1
- package/dist/modules/agent/runtime/app/tools/add_paragraphs/index.d.ts +1 -1
- package/dist/modules/agent/runtime/app/tools/add_reusable_paragraph/index.d.ts +1 -1
- package/dist/modules/agent/runtime/app/tools/add_template/index.d.ts +1 -1
- package/dist/modules/agent/runtime/app/tools/ask_question/Component.vue +1 -1
- package/dist/modules/agent/runtime/app/tools/ask_question/index.d.ts +1 -1
- package/dist/modules/agent/runtime/app/tools/auto_translate_paragraphs/index.d.ts +1 -1
- package/dist/modules/agent/runtime/app/tools/delete_paragraphs/index.d.ts +1 -1
- package/dist/modules/agent/runtime/app/tools/detach_reusable_paragraph/index.d.ts +1 -1
- package/dist/modules/agent/runtime/app/tools/duplicate_paragraphs/index.d.ts +1 -1
- package/dist/modules/agent/runtime/app/tools/fieldDiffApproval.js +1 -3
- package/dist/modules/agent/runtime/app/tools/find_paragraphs/index.d.ts +2 -2
- package/dist/modules/agent/runtime/app/tools/get_bundle_info/index.js +6 -2
- package/dist/modules/agent/runtime/app/tools/get_content_fields/index.d.ts +3 -3
- package/dist/modules/agent/runtime/app/tools/get_paragraph_context/index.d.ts +5 -5
- package/dist/modules/agent/runtime/app/tools/get_paragraphs_in_viewport/index.d.ts +1 -1
- package/dist/modules/agent/runtime/app/tools/get_referenced_entities/index.d.ts +1 -1
- package/dist/modules/agent/runtime/app/tools/go_to_history_index/index.d.ts +1 -1
- package/dist/modules/agent/runtime/app/tools/move_paragraphs/index.d.ts +1 -1
- package/dist/modules/agent/runtime/app/tools/rearrange_paragraphs/index.d.ts +1 -1
- package/dist/modules/agent/runtime/app/tools/replace_content_search_item/index.d.ts +1 -1
- package/dist/modules/agent/runtime/app/tools/replace_media_field/index.d.ts +1 -1
- package/dist/modules/agent/runtime/app/tools/schemas.d.ts +2 -2
- package/dist/modules/agent/runtime/app/tools/set_paragraph_options/index.d.ts +1 -1
- package/dist/modules/agent/runtime/app/tools/swap_paragraphs/index.d.ts +1 -1
- package/dist/modules/agent/runtime/app/tools/update_text_fields/index.d.ts +3 -3
- package/dist/modules/agent/runtime/server/classes/FieldStreamParser/index.js +10 -15
- package/dist/modules/agent/runtime/shared/toolParams.d.ts +3 -3
- package/dist/modules/agent/runtime/shared/types.d.ts +3 -3
- package/dist/modules/charts/index.d.mts +14 -1
- package/dist/modules/charts/index.mjs +37 -2
- package/dist/modules/charts/runtime/features/charts/Editor/AdvancedConfigPanel/index.vue +1 -1
- package/dist/modules/charts/runtime/features/charts/Editor/ChartTypeOptions/Field.vue +19 -9
- package/dist/modules/charts/runtime/features/charts/Editor/CsvImport/OutputPreviewTable/index.vue +1 -1
- package/dist/modules/charts/runtime/features/charts/Editor/DataTable/index.vue +16 -8
- package/dist/modules/charts/runtime/features/charts/Editor/NumberFormatEditor/index.vue +23 -7
- package/dist/modules/charts/runtime/features/charts/Editor/index.vue +5 -6
- package/dist/modules/drupal/graphql/base/fragment.paragraphsBlokkliEditState.graphql +5 -0
- package/dist/modules/drupal/index.d.mts +1 -1
- package/dist/modules/drupal/runtime/adapter/index.js +3 -0
- package/dist/modules/iframes/index.d.mts +1 -1
- package/dist/modules/index.d.mts +1 -1
- package/dist/modules/readability/index.d.mts +1 -1
- package/dist/modules/readability/index.mjs +2 -1
- package/dist/modules/table-of-contents/index.d.mts +1 -1
- package/dist/runtime/components/Blocks/NotImplemented/index.vue +1 -1
- package/dist/runtime/editor/components/Actions/Title/index.vue +1 -1
- package/dist/runtime/editor/components/Actions/index.vue +1 -1
- package/dist/runtime/editor/components/ArtboardTooltip/index.d.vue.ts +1 -0
- package/dist/runtime/editor/components/ArtboardTooltip/index.vue +2 -2
- package/dist/runtime/editor/components/ArtboardTooltip/index.vue.d.ts +1 -0
- package/dist/runtime/editor/components/Avatar/index.vue +1 -1
- package/dist/runtime/editor/components/BlockPreviewItem/index.vue +1 -1
- package/dist/runtime/editor/components/BlockPreviewRenderer/index.vue +1 -1
- package/dist/runtime/editor/components/BlockProxy/index.vue +1 -1
- package/dist/runtime/editor/components/BlokkliRootErrorBoundary.vue +1 -1
- package/dist/runtime/editor/components/BundleSelector/index.vue +1 -1
- package/dist/runtime/editor/components/ColorDropdown/index.vue +1 -1
- package/dist/runtime/editor/components/Dialog/index.vue +1 -1
- package/dist/runtime/editor/components/DiffApproval/Toolbar/index.vue +1 -1
- package/dist/runtime/editor/components/DiffApproval/types.js +1 -3
- package/dist/runtime/editor/components/DiffViewer/State.vue +1 -1
- package/dist/runtime/editor/components/DraggableList.vue +1 -1
- package/dist/runtime/editor/components/Dropdown/index.d.vue.ts +1 -0
- package/dist/runtime/editor/components/Dropdown/index.vue +2 -2
- package/dist/runtime/editor/components/Dropdown/index.vue.d.ts +1 -0
- package/dist/runtime/editor/components/DropdownItem/index.vue +1 -1
- package/dist/runtime/editor/components/EditIndicator.vue +1 -1
- package/dist/runtime/editor/components/EditProvider.vue +2 -2
- package/dist/runtime/editor/components/FileDropHandler/index.vue +1 -1
- package/dist/runtime/editor/components/Form/RadioTabs/index.vue +1 -1
- package/dist/runtime/editor/components/Form/Search/index.d.vue.ts +1 -0
- package/dist/runtime/editor/components/Form/Search/index.vue +2 -2
- package/dist/runtime/editor/components/Form/Search/index.vue.d.ts +1 -0
- package/dist/runtime/editor/components/FormOverlay/index.vue +1 -1
- package/dist/runtime/editor/components/Icon/index.vue +1 -1
- package/dist/runtime/editor/components/Indicators/index.vue +31 -100
- package/dist/runtime/editor/components/Konami/Game/index.vue +1 -1
- package/dist/runtime/editor/components/Messages/index.vue +1 -1
- package/dist/runtime/editor/components/NestedEditorOverlay/index.d.vue.ts +1 -0
- package/dist/runtime/editor/components/NestedEditorOverlay/index.vue +2 -1
- package/dist/runtime/editor/components/NestedEditorOverlay/index.vue.d.ts +1 -0
- package/dist/runtime/editor/components/Overlay/index.vue +1 -1
- package/dist/runtime/editor/components/Pagination/index.vue +1 -1
- package/dist/runtime/editor/components/Panel/Section/index.vue +1 -1
- package/dist/runtime/editor/components/Panel/Tabs/index.d.vue.ts +1 -1
- package/dist/runtime/editor/components/Panel/Tabs/index.vue.d.ts +1 -1
- package/dist/runtime/editor/components/PluginConfigForm/index.vue +1 -1
- package/dist/runtime/editor/components/PluginConfigFormInline/FilterSelect/index.vue +1 -1
- package/dist/runtime/editor/components/PluginConfigFormInline/index.vue +1 -1
- package/dist/runtime/editor/components/Popup/index.vue +1 -1
- package/dist/runtime/editor/components/PreviewProvider.vue +3 -2
- package/dist/runtime/editor/components/RelativeTime/index.vue +7 -13
- package/dist/runtime/editor/components/Resizable/index.vue +1 -1
- package/dist/runtime/editor/components/RichText/Editor/index.vue +1 -1
- package/dist/runtime/editor/components/ScaleToFit/index.vue +1 -1
- package/dist/runtime/editor/components/SearchOverlay/index.vue +1 -1
- package/dist/runtime/editor/components/SidebarFloater/index.vue +1 -1
- package/dist/runtime/editor/components/StatusIcon/index.vue +1 -1
- package/dist/runtime/editor/components/StatusIndicator/index.vue +1 -1
- package/dist/runtime/editor/components/SystemRequirements/index.vue +1 -1
- package/dist/runtime/editor/components/Tabs/index.d.vue.ts +1 -1
- package/dist/runtime/editor/components/Tabs/index.vue.d.ts +1 -1
- package/dist/runtime/editor/components/Toolbar/ViewOptions/List/Button/index.vue +2 -1
- package/dist/runtime/editor/components/Toolbar/index.vue +1 -1
- package/dist/runtime/editor/components/Transition/Collapse/index.vue +1 -1
- package/dist/runtime/editor/components/Transition/List/index.vue +1 -1
- package/dist/runtime/editor/composables/defineViewOption.js +5 -1
- package/dist/runtime/editor/composables/useStickyToolbar.js +1 -4
- package/dist/runtime/editor/css/output.css +1 -1
- package/dist/runtime/editor/features/add-list/Help/index.vue +1 -1
- package/dist/runtime/editor/features/add-list/index.vue +1 -1
- package/dist/runtime/editor/features/analyze/index.vue +1 -1
- package/dist/runtime/editor/features/anchors/Overlay/index.vue +11 -5
- package/dist/runtime/editor/features/anchors/index.vue +2 -1
- package/dist/runtime/editor/features/artboard/Overview/index.vue +1 -1
- package/dist/runtime/editor/features/artboard/Renderer.vue +1 -1
- package/dist/runtime/editor/features/artboard/Scrollbar/index.vue +1 -1
- package/dist/runtime/editor/features/block-scheduler/Dialog/index.vue +1 -1
- package/dist/runtime/editor/features/block-transfer/index.vue +1 -1
- package/dist/runtime/editor/features/breadcrumbs/index.vue +1 -1
- package/dist/runtime/editor/features/changelog/changelog.json +8 -0
- package/dist/runtime/editor/features/clipboard/DropElement/index.vue +1 -1
- package/dist/runtime/editor/features/comments/AddForm/index.vue +1 -1
- package/dist/runtime/editor/features/comments/Thread/index.vue +1 -1
- package/dist/runtime/editor/features/complex-options/index.vue +1 -0
- package/dist/runtime/editor/features/debug/Main.vue +1 -1
- package/dist/runtime/editor/features/dev-mode/index.vue +1 -1
- package/dist/runtime/editor/features/dragging-overlay/DragItems/index.vue +1 -1
- package/dist/runtime/editor/features/dragging-overlay/index.vue +1 -1
- package/dist/runtime/editor/features/droppable-field-edit/Overlay/index.vue +1 -1
- package/dist/runtime/editor/features/editable-field/Overlay/Frame/index.vue +1 -1
- package/dist/runtime/editor/features/editable-field/Overlay/Plaintext/index.d.vue.ts +1 -5
- package/dist/runtime/editor/features/editable-field/Overlay/Plaintext/index.vue.d.ts +1 -5
- package/dist/runtime/editor/features/editable-field/Overlay/ReadabilityIndicator/ChunkOverlay.vue +1 -1
- package/dist/runtime/editor/features/editable-field/Overlay/index.vue +1 -1
- package/dist/runtime/editor/features/editable-mask/index.vue +1 -1
- package/dist/runtime/editor/features/entity-title/index.vue +17 -7
- package/dist/runtime/editor/features/help/Dialog/index.vue +1 -1
- package/dist/runtime/editor/features/help/Shortcuts/index.vue +1 -1
- package/dist/runtime/editor/features/history/List/index.vue +1 -1
- package/dist/runtime/editor/features/import-existing/Dialog/index.vue +1 -1
- package/dist/runtime/editor/features/library/index.vue +1 -0
- package/dist/runtime/editor/features/media-library/index.vue +1 -1
- package/dist/runtime/editor/features/options/Form/Item.vue +5 -12
- package/dist/runtime/editor/features/options/Form/Radios/index.d.vue.ts +5 -4
- package/dist/runtime/editor/features/options/Form/Radios/index.vue +8 -5
- package/dist/runtime/editor/features/options/Form/Radios/index.vue.d.ts +5 -4
- package/dist/runtime/editor/features/options/Form/Text/index.d.vue.ts +4 -0
- package/dist/runtime/editor/features/options/Form/Text/index.vue +11 -3
- package/dist/runtime/editor/features/options/Form/Text/index.vue.d.ts +4 -0
- package/dist/runtime/editor/features/options/index.vue +1 -1
- package/dist/runtime/editor/features/publish/Dialog/Item.vue +4 -7
- package/dist/runtime/editor/features/publish/Dialog/PublishOption.vue +1 -1
- package/dist/runtime/editor/features/referenced-entities/List/Item/index.vue +1 -0
- package/dist/runtime/editor/features/responsive-preview/Frame/index.vue +1 -1
- package/dist/runtime/editor/features/search/index.vue +1 -1
- package/dist/runtime/editor/features/selection/AddButtons/Renderer/index.vue +1 -1
- package/dist/runtime/editor/features/settings/Dialog/FeatureSetting/index.vue +1 -1
- package/dist/runtime/editor/features/settings/index.vue +1 -1
- package/dist/runtime/editor/features/structure/List/Item/index.vue +1 -1
- package/dist/runtime/editor/features/structure/index.vue +1 -1
- package/dist/runtime/editor/features/templates/DialogManageTemplates/Item.vue +1 -0
- package/dist/runtime/editor/features/templates/DialogManageTemplates/index.vue +1 -1
- package/dist/runtime/editor/features/theme/index.vue +1 -1
- package/dist/runtime/editor/features/touch-action-bar/Bar/index.vue +1 -1
- package/dist/runtime/editor/features/tour/Overlay/index.vue +1 -1
- package/dist/runtime/editor/features/transform/Dialog/index.vue +1 -1
- package/dist/runtime/editor/features/translations/SelectionTable/index.vue +1 -1
- package/dist/runtime/editor/features/workspace/index.vue +1 -1
- package/dist/runtime/editor/helpers/diff/index.d.ts +11 -0
- package/dist/runtime/editor/helpers/diff/index.js +13 -7
- package/dist/runtime/editor/helpers/options/index.d.ts +2 -0
- package/dist/runtime/editor/helpers/options/index.js +21 -0
- package/dist/runtime/editor/plugins/BlockIndicator/index.d.vue.ts +24 -1
- package/dist/runtime/editor/plugins/BlockIndicator/index.vue +17 -7
- package/dist/runtime/editor/plugins/BlockIndicator/index.vue.d.ts +24 -1
- package/dist/runtime/editor/plugins/ItemAction/index.d.vue.ts +1 -0
- package/dist/runtime/editor/plugins/ItemAction/index.vue +1 -1
- package/dist/runtime/editor/plugins/ItemAction/index.vue.d.ts +1 -0
- package/dist/runtime/editor/plugins/Sidebar/index.vue +1 -1
- package/dist/runtime/editor/plugins/ToolbarButton/index.vue +1 -1
- package/dist/runtime/editor/providers/animation.d.ts +2 -0
- package/dist/runtime/editor/providers/definition.d.ts +4 -3
- package/dist/runtime/editor/providers/definition.js +10 -2
- package/dist/runtime/editor/providers/plugin.d.ts +1 -0
- package/dist/runtime/editor/providers/state.d.ts +8 -0
- package/dist/runtime/editor/providers/state.js +3 -0
- package/dist/runtime/editor/translations/de.json +2 -0
- package/dist/runtime/editor/translations/fr.json +2 -0
- package/dist/runtime/editor/translations/gsw_CH.json +2 -0
- package/dist/runtime/editor/translations/it.json +2 -0
- package/dist/runtime/editor/types/state.d.ts +7 -0
- package/dist/runtime/editor/types/ui.d.ts +1 -0
- package/dist/shared/{editor.D28NbXr3.d.mts → editor.BDyiQvbV.d.mts} +434 -406
- package/dist/shared/{editor.Gu7mgJ5Q.mjs → editor.BGemL1Oh.mjs} +146 -146
- package/dist/types.d.mts +1 -1
- package/package.json +74 -82
|
@@ -1,151 +1,6 @@
|
|
|
1
1
|
import * as ts from 'typescript';
|
|
2
2
|
import { parseAndWalk } from 'oxc-walker';
|
|
3
3
|
|
|
4
|
-
class CollectedFile {
|
|
5
|
-
constructor(filePath, fileContents) {
|
|
6
|
-
this.filePath = filePath;
|
|
7
|
-
this.fileContents = fileContents;
|
|
8
|
-
}
|
|
9
|
-
async handleChange(_helper) {
|
|
10
|
-
return Promise.resolve(true);
|
|
11
|
-
}
|
|
12
|
-
/**
|
|
13
|
-
* Validate the collected file and return any errors.
|
|
14
|
-
* Override this method in subclasses to add validation logic.
|
|
15
|
-
*/
|
|
16
|
-
validate(_icons) {
|
|
17
|
-
return [];
|
|
18
|
-
}
|
|
19
|
-
}
|
|
20
|
-
class Collector {
|
|
21
|
-
constructor(helper) {
|
|
22
|
-
this.helper = helper;
|
|
23
|
-
this.files = /* @__PURE__ */ new Map();
|
|
24
|
-
}
|
|
25
|
-
files;
|
|
26
|
-
needsFileContents = true;
|
|
27
|
-
async addFile(filePath) {
|
|
28
|
-
if (this.needsFileContents) {
|
|
29
|
-
const contents = await this.helper.fileCache.read(filePath);
|
|
30
|
-
const file = this.createCollectedFile(filePath, contents.toString());
|
|
31
|
-
await file.handleChange(this.helper);
|
|
32
|
-
this.files.set(filePath, file);
|
|
33
|
-
} else {
|
|
34
|
-
const file = this.createCollectedFile(filePath);
|
|
35
|
-
await file.handleChange(this.helper);
|
|
36
|
-
this.files.set(filePath, file);
|
|
37
|
-
}
|
|
38
|
-
}
|
|
39
|
-
async handleAdd(filePath) {
|
|
40
|
-
const applies = await this.applies(filePath);
|
|
41
|
-
if (applies) {
|
|
42
|
-
await this.addFile(filePath);
|
|
43
|
-
return true;
|
|
44
|
-
}
|
|
45
|
-
return false;
|
|
46
|
-
}
|
|
47
|
-
async handleChange(filePath) {
|
|
48
|
-
const applies = await this.applies(filePath);
|
|
49
|
-
if (!applies) {
|
|
50
|
-
return this.handleUnlink(filePath);
|
|
51
|
-
}
|
|
52
|
-
const file = this.files.get(filePath);
|
|
53
|
-
if (!file) {
|
|
54
|
-
return false;
|
|
55
|
-
}
|
|
56
|
-
if (this.needsFileContents) {
|
|
57
|
-
const contents = await this.helper.fileCache.read(filePath);
|
|
58
|
-
file.fileContents = contents.toString();
|
|
59
|
-
return await file.handleChange(this.helper);
|
|
60
|
-
}
|
|
61
|
-
return true;
|
|
62
|
-
}
|
|
63
|
-
handleUnlink(filePath) {
|
|
64
|
-
if (this.files.has(filePath)) {
|
|
65
|
-
this.files.delete(filePath);
|
|
66
|
-
return true;
|
|
67
|
-
}
|
|
68
|
-
return false;
|
|
69
|
-
}
|
|
70
|
-
handleAddDir() {
|
|
71
|
-
return false;
|
|
72
|
-
}
|
|
73
|
-
handleUnlinkDir(folderPath) {
|
|
74
|
-
const allKeys = [...this.files.keys()];
|
|
75
|
-
const toRemove = allKeys.filter((filePath) => filePath.includes(folderPath));
|
|
76
|
-
if (toRemove.length) {
|
|
77
|
-
toRemove.forEach((key) => this.files.delete(key));
|
|
78
|
-
return true;
|
|
79
|
-
}
|
|
80
|
-
return false;
|
|
81
|
-
}
|
|
82
|
-
async handleWatchEvent(event, filePath) {
|
|
83
|
-
let hasChanged = false;
|
|
84
|
-
if (event === "add") {
|
|
85
|
-
hasChanged = await this.handleAdd(filePath);
|
|
86
|
-
} else if (event === "change") {
|
|
87
|
-
hasChanged = await this.handleChange(filePath);
|
|
88
|
-
} else if (event === "unlink") {
|
|
89
|
-
hasChanged = await this.handleUnlink(filePath);
|
|
90
|
-
} else if (event === "addDir") {
|
|
91
|
-
hasChanged = this.handleAddDir();
|
|
92
|
-
} else if (event === "unlinkDir") {
|
|
93
|
-
hasChanged = this.handleUnlinkDir(filePath);
|
|
94
|
-
}
|
|
95
|
-
return { hasChanged };
|
|
96
|
-
}
|
|
97
|
-
/**
|
|
98
|
-
* Validate all collected files and log any errors/warnings to the console.
|
|
99
|
-
* @returns true if there are validation errors (not warnings), false otherwise.
|
|
100
|
-
*/
|
|
101
|
-
validate(icons) {
|
|
102
|
-
const allIssues = [];
|
|
103
|
-
for (const file of this.files.values()) {
|
|
104
|
-
const issues = file.validate(icons);
|
|
105
|
-
if (issues.length > 0) {
|
|
106
|
-
allIssues.push({ filePath: file.filePath, issues });
|
|
107
|
-
}
|
|
108
|
-
}
|
|
109
|
-
if (allIssues.length === 0) {
|
|
110
|
-
return false;
|
|
111
|
-
}
|
|
112
|
-
const errors = [];
|
|
113
|
-
const warnings = [];
|
|
114
|
-
for (const { filePath, issues } of allIssues) {
|
|
115
|
-
const fileErrors = issues.filter((i) => i.severity !== "warning");
|
|
116
|
-
const fileWarnings = issues.filter((i) => i.severity === "warning");
|
|
117
|
-
if (fileErrors.length > 0) {
|
|
118
|
-
errors.push({ filePath, issues: fileErrors });
|
|
119
|
-
}
|
|
120
|
-
if (fileWarnings.length > 0) {
|
|
121
|
-
warnings.push({ filePath, issues: fileWarnings });
|
|
122
|
-
}
|
|
123
|
-
}
|
|
124
|
-
if (warnings.length > 0) {
|
|
125
|
-
const lines = warnings.flatMap(({ filePath, issues }) => [
|
|
126
|
-
` ${filePath}:`,
|
|
127
|
-
...issues.map((e) => ` - ${e.message}`)
|
|
128
|
-
]);
|
|
129
|
-
this.helper.logger.warn(
|
|
130
|
-
`bl\xF6kkli validation warnings:
|
|
131
|
-
${lines.join("\n")}`
|
|
132
|
-
);
|
|
133
|
-
}
|
|
134
|
-
if (errors.length > 0) {
|
|
135
|
-
const lines = errors.flatMap(({ filePath, issues }) => [
|
|
136
|
-
` ${filePath}:`,
|
|
137
|
-
...issues.map((e) => ` - ${e.message}`)
|
|
138
|
-
]);
|
|
139
|
-
this.helper.logger.error(
|
|
140
|
-
`bl\xF6kkli validation errors:
|
|
141
|
-
${lines.join("\n")}`
|
|
142
|
-
);
|
|
143
|
-
return true;
|
|
144
|
-
}
|
|
145
|
-
return false;
|
|
146
|
-
}
|
|
147
|
-
}
|
|
148
|
-
|
|
149
4
|
function sortObjectKeys(obj) {
|
|
150
5
|
if (Array.isArray(obj)) {
|
|
151
6
|
return obj.map(sortObjectKeys);
|
|
@@ -317,4 +172,149 @@ function onlyUnique(value, index, self) {
|
|
|
317
172
|
return self.indexOf(value) === index;
|
|
318
173
|
}
|
|
319
174
|
|
|
320
|
-
|
|
175
|
+
class CollectedFile {
|
|
176
|
+
constructor(filePath, fileContents) {
|
|
177
|
+
this.filePath = filePath;
|
|
178
|
+
this.fileContents = fileContents;
|
|
179
|
+
}
|
|
180
|
+
async handleChange(_helper) {
|
|
181
|
+
return Promise.resolve(true);
|
|
182
|
+
}
|
|
183
|
+
/**
|
|
184
|
+
* Validate the collected file and return any errors.
|
|
185
|
+
* Override this method in subclasses to add validation logic.
|
|
186
|
+
*/
|
|
187
|
+
validate(_icons) {
|
|
188
|
+
return [];
|
|
189
|
+
}
|
|
190
|
+
}
|
|
191
|
+
class Collector {
|
|
192
|
+
constructor(helper) {
|
|
193
|
+
this.helper = helper;
|
|
194
|
+
this.files = /* @__PURE__ */ new Map();
|
|
195
|
+
}
|
|
196
|
+
files;
|
|
197
|
+
needsFileContents = true;
|
|
198
|
+
async addFile(filePath) {
|
|
199
|
+
if (this.needsFileContents) {
|
|
200
|
+
const contents = await this.helper.fileCache.read(filePath);
|
|
201
|
+
const file = this.createCollectedFile(filePath, contents.toString());
|
|
202
|
+
await file.handleChange(this.helper);
|
|
203
|
+
this.files.set(filePath, file);
|
|
204
|
+
} else {
|
|
205
|
+
const file = this.createCollectedFile(filePath);
|
|
206
|
+
await file.handleChange(this.helper);
|
|
207
|
+
this.files.set(filePath, file);
|
|
208
|
+
}
|
|
209
|
+
}
|
|
210
|
+
async handleAdd(filePath) {
|
|
211
|
+
const applies = await this.applies(filePath);
|
|
212
|
+
if (applies) {
|
|
213
|
+
await this.addFile(filePath);
|
|
214
|
+
return true;
|
|
215
|
+
}
|
|
216
|
+
return false;
|
|
217
|
+
}
|
|
218
|
+
async handleChange(filePath) {
|
|
219
|
+
const applies = await this.applies(filePath);
|
|
220
|
+
if (!applies) {
|
|
221
|
+
return this.handleUnlink(filePath);
|
|
222
|
+
}
|
|
223
|
+
const file = this.files.get(filePath);
|
|
224
|
+
if (!file) {
|
|
225
|
+
return false;
|
|
226
|
+
}
|
|
227
|
+
if (this.needsFileContents) {
|
|
228
|
+
const contents = await this.helper.fileCache.read(filePath);
|
|
229
|
+
file.fileContents = contents.toString();
|
|
230
|
+
return await file.handleChange(this.helper);
|
|
231
|
+
}
|
|
232
|
+
return true;
|
|
233
|
+
}
|
|
234
|
+
handleUnlink(filePath) {
|
|
235
|
+
if (this.files.has(filePath)) {
|
|
236
|
+
this.files.delete(filePath);
|
|
237
|
+
return true;
|
|
238
|
+
}
|
|
239
|
+
return false;
|
|
240
|
+
}
|
|
241
|
+
handleAddDir() {
|
|
242
|
+
return false;
|
|
243
|
+
}
|
|
244
|
+
handleUnlinkDir(folderPath) {
|
|
245
|
+
const allKeys = [...this.files.keys()];
|
|
246
|
+
const toRemove = allKeys.filter((filePath) => filePath.includes(folderPath));
|
|
247
|
+
if (toRemove.length) {
|
|
248
|
+
toRemove.forEach((key) => this.files.delete(key));
|
|
249
|
+
return true;
|
|
250
|
+
}
|
|
251
|
+
return false;
|
|
252
|
+
}
|
|
253
|
+
async handleWatchEvent(event, filePath) {
|
|
254
|
+
let hasChanged = false;
|
|
255
|
+
if (event === "add") {
|
|
256
|
+
hasChanged = await this.handleAdd(filePath);
|
|
257
|
+
} else if (event === "change") {
|
|
258
|
+
hasChanged = await this.handleChange(filePath);
|
|
259
|
+
} else if (event === "unlink") {
|
|
260
|
+
hasChanged = await this.handleUnlink(filePath);
|
|
261
|
+
} else if (event === "addDir") {
|
|
262
|
+
hasChanged = this.handleAddDir();
|
|
263
|
+
} else if (event === "unlinkDir") {
|
|
264
|
+
hasChanged = this.handleUnlinkDir(filePath);
|
|
265
|
+
}
|
|
266
|
+
return { hasChanged };
|
|
267
|
+
}
|
|
268
|
+
/**
|
|
269
|
+
* Validate all collected files and log any errors/warnings to the console.
|
|
270
|
+
* @returns true if there are validation errors (not warnings), false otherwise.
|
|
271
|
+
*/
|
|
272
|
+
validate(icons) {
|
|
273
|
+
const allIssues = [];
|
|
274
|
+
for (const file of this.files.values()) {
|
|
275
|
+
const issues = file.validate(icons);
|
|
276
|
+
if (issues.length > 0) {
|
|
277
|
+
allIssues.push({ filePath: file.filePath, issues });
|
|
278
|
+
}
|
|
279
|
+
}
|
|
280
|
+
if (allIssues.length === 0) {
|
|
281
|
+
return false;
|
|
282
|
+
}
|
|
283
|
+
const errors = [];
|
|
284
|
+
const warnings = [];
|
|
285
|
+
for (const { filePath, issues } of allIssues) {
|
|
286
|
+
const fileErrors = issues.filter((i) => i.severity !== "warning");
|
|
287
|
+
const fileWarnings = issues.filter((i) => i.severity === "warning");
|
|
288
|
+
if (fileErrors.length > 0) {
|
|
289
|
+
errors.push({ filePath, issues: fileErrors });
|
|
290
|
+
}
|
|
291
|
+
if (fileWarnings.length > 0) {
|
|
292
|
+
warnings.push({ filePath, issues: fileWarnings });
|
|
293
|
+
}
|
|
294
|
+
}
|
|
295
|
+
if (warnings.length > 0) {
|
|
296
|
+
const lines = warnings.flatMap(({ filePath, issues }) => [
|
|
297
|
+
` ${filePath}:`,
|
|
298
|
+
...issues.map((e) => ` - ${e.message}`)
|
|
299
|
+
]);
|
|
300
|
+
this.helper.logger.warn(
|
|
301
|
+
`bl\xF6kkli validation warnings:
|
|
302
|
+
${lines.join("\n")}`
|
|
303
|
+
);
|
|
304
|
+
}
|
|
305
|
+
if (errors.length > 0) {
|
|
306
|
+
const lines = errors.flatMap(({ filePath, issues }) => [
|
|
307
|
+
` ${filePath}:`,
|
|
308
|
+
...issues.map((e) => ` - ${e.message}`)
|
|
309
|
+
]);
|
|
310
|
+
this.helper.logger.error(
|
|
311
|
+
`bl\xF6kkli validation errors:
|
|
312
|
+
${lines.join("\n")}`
|
|
313
|
+
);
|
|
314
|
+
return true;
|
|
315
|
+
}
|
|
316
|
+
return false;
|
|
317
|
+
}
|
|
318
|
+
}
|
|
319
|
+
|
|
320
|
+
export { Collector as C, CollectedFile as a, extractFirstStringArg as b, extractObjectLiteral as c, extractStringProperty as e, falsy as f, onlyUnique as o, parseTsObject as p, sortObjectKeys as s, toValidVariableName as t };
|
package/dist/types.d.mts
CHANGED
|
@@ -4,6 +4,6 @@ declare module '@nuxt/schema' {
|
|
|
4
4
|
interface NuxtHooks extends ModuleHooks {}
|
|
5
5
|
}
|
|
6
6
|
|
|
7
|
-
export { type ModuleHooks } from './shared/editor.
|
|
7
|
+
export { type ModuleHooks } from './shared/editor.BDyiQvbV.mjs'
|
|
8
8
|
|
|
9
9
|
export { type ModuleOptions, default } from './module.mjs'
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@blokkli/editor",
|
|
3
|
-
"version": "2.0.0-alpha.
|
|
3
|
+
"version": "2.0.0-alpha.64",
|
|
4
4
|
"description": "Interactive page building experience for Nuxt",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"cms",
|
|
@@ -104,9 +104,9 @@
|
|
|
104
104
|
}
|
|
105
105
|
},
|
|
106
106
|
"scripts": {
|
|
107
|
-
"prepack": "rm -rf dist && nuxt-module-build build &&
|
|
107
|
+
"prepack": "rm -rf dist && nuxt-module-build build && bunx tsx scripts/mangle-dist.ts",
|
|
108
108
|
"dev": "nuxi dev playground --host",
|
|
109
|
-
"typecheck": "
|
|
109
|
+
"typecheck": "bun run typecheck:build && bun run typecheck:runtime && bun run typecheck:server && bun run typecheck:playground",
|
|
110
110
|
"typecheck:build": "vue-tsc --noEmit -p .nuxt/tsconfig.node.json",
|
|
111
111
|
"typecheck:runtime": "vue-tsc --noEmit -p .nuxt/tsconfig.app.json",
|
|
112
112
|
"typecheck:server": "vue-tsc --noEmit -p .nuxt/tsconfig.server.json",
|
|
@@ -114,119 +114,118 @@
|
|
|
114
114
|
"dev:minimal": "nuxi dev playground-minimal --host",
|
|
115
115
|
"styles:build": "postcss ./css/index.css -o ./src/runtime/editor/css/output.css",
|
|
116
116
|
"styles:watch": "postcss ./css/index.css -o ./src/runtime/editor/css/output.css --watch",
|
|
117
|
-
"dev:build": "
|
|
117
|
+
"dev:build": "bun run changelog && bun run dev:prepare && nuxi generate playground",
|
|
118
118
|
"dev:build-ssr": "PLAYGROUND_SSR_BUILD=true nuxt build playground",
|
|
119
|
-
"dev:start": "
|
|
119
|
+
"dev:start": "bunx serve playground/.output/public",
|
|
120
120
|
"dev:start-ssr": "cd playground && node -r dotenv/config ./.output/server/index.mjs",
|
|
121
121
|
"dev:prepare": "PLAYGROUND_MODULE_BUILD=true nuxt-module-build build --stub && PLAYGROUND_MODULE_BUILD=true nuxt-module-build prepare && nuxi prepare playground",
|
|
122
|
-
"dev:analyze": "
|
|
123
|
-
"release": "
|
|
122
|
+
"dev:analyze": "bunx nuxt analyze playground",
|
|
123
|
+
"release": "bun run lint && bun run prepack && changelogen --release",
|
|
124
124
|
"changelog": "node ./scripts/changelog/index.cjs",
|
|
125
125
|
"texts": "node ./scripts/texts/index.cjs",
|
|
126
126
|
"material-icons": "node ./scripts/material-icons/index.cjs",
|
|
127
|
-
"lint": "
|
|
128
|
-
"lint:fix": "
|
|
129
|
-
"test": "
|
|
127
|
+
"lint": "bunx oxlint && eslint ./src",
|
|
128
|
+
"lint:fix": "bunx oxlint --fix && eslint ./src --fix",
|
|
129
|
+
"test": "bun run test:unit && bun run test:e2e",
|
|
130
130
|
"test:watch": "vitest watch --project unit --project e2e --no-file-parallelism",
|
|
131
131
|
"test:unit": "vitest run --project unit",
|
|
132
132
|
"test:unit:watch": "vitest watch --project unit",
|
|
133
133
|
"test:e2e": "vitest run --project e2e",
|
|
134
|
-
"format": "prettier
|
|
135
|
-
"format:fix": "prettier
|
|
134
|
+
"format": "oxfmt --check && prettier '**/*.graphql' --check",
|
|
135
|
+
"format:fix": "oxfmt --write && prettier '**/*.graphql' --write",
|
|
136
136
|
"docs:dev": "vitepress dev docs",
|
|
137
137
|
"docs:build": "vitepress build docs",
|
|
138
138
|
"docs:preview": "vitepress preview docs"
|
|
139
139
|
},
|
|
140
140
|
"dependencies": {
|
|
141
141
|
"@floating-ui/dom": "^1.7.6",
|
|
142
|
-
"@material-symbols/svg-600": "0.
|
|
143
|
-
"@tiptap/core": "^3.
|
|
144
|
-
"@tiptap/extension-emoji": "^3.
|
|
145
|
-
"@tiptap/extension-mention": "^3.
|
|
146
|
-
"@tiptap/extension-task-item": "^3.
|
|
147
|
-
"@tiptap/extension-task-list": "^3.
|
|
148
|
-
"@tiptap/pm": "^3.
|
|
149
|
-
"@tiptap/starter-kit": "^3.
|
|
150
|
-
"@tiptap/suggestion": "^3.
|
|
151
|
-
"@tiptap/vue-3": "^3.
|
|
142
|
+
"@material-symbols/svg-600": "0.45.1",
|
|
143
|
+
"@tiptap/core": "^3.26.1",
|
|
144
|
+
"@tiptap/extension-emoji": "^3.26.1",
|
|
145
|
+
"@tiptap/extension-mention": "^3.26.1",
|
|
146
|
+
"@tiptap/extension-task-item": "^3.26.1",
|
|
147
|
+
"@tiptap/extension-task-list": "^3.26.1",
|
|
148
|
+
"@tiptap/pm": "^3.26.1",
|
|
149
|
+
"@tiptap/starter-kit": "^3.26.1",
|
|
150
|
+
"@tiptap/suggestion": "^3.26.1",
|
|
151
|
+
"@tiptap/vue-3": "^3.26.1",
|
|
152
152
|
"artboard-deluxe": "^0.1.5",
|
|
153
|
-
"echarts": "^6.
|
|
153
|
+
"echarts": "^6.1.0",
|
|
154
154
|
"estree-walker-ts": "^1.1.0",
|
|
155
155
|
"fzf": "^0.5.2",
|
|
156
|
-
"get-video-id": "^4.
|
|
156
|
+
"get-video-id": "^4.2.0",
|
|
157
157
|
"html-diff-ts": "^1.4.2",
|
|
158
158
|
"json5": "^2.2.3",
|
|
159
|
-
"marked": "^
|
|
159
|
+
"marked": "^18.0.5",
|
|
160
160
|
"mitt": "^3.0.1",
|
|
161
161
|
"papaparse": "^5.5.3",
|
|
162
162
|
"pofile": "^1.1.4",
|
|
163
|
-
"qrcode.vue": "^3.
|
|
163
|
+
"qrcode.vue": "^3.10.0",
|
|
164
164
|
"twgl.js": "^7.0.0",
|
|
165
165
|
"vue-echarts": "^8.0.1",
|
|
166
|
-
"zod": "^4.
|
|
166
|
+
"zod": "^4.4.3"
|
|
167
167
|
},
|
|
168
168
|
"devDependencies": {
|
|
169
|
-
"@anthropic-ai/sdk": "^0.
|
|
170
|
-
"@ckeditor/ckeditor5-vue": "^8.
|
|
171
|
-
"@nuxt/devtools": "^3.
|
|
172
|
-
"@nuxt/eslint-config": "^1.
|
|
173
|
-
"@nuxt/kit": "^4.4.
|
|
169
|
+
"@anthropic-ai/sdk": "^0.104.1",
|
|
170
|
+
"@ckeditor/ckeditor5-vue": "^8.1.1",
|
|
171
|
+
"@nuxt/devtools": "^3.2.4",
|
|
172
|
+
"@nuxt/eslint-config": "^1.16.0",
|
|
173
|
+
"@nuxt/kit": "^4.4.8",
|
|
174
174
|
"@nuxt/module-builder": "^1.0.2",
|
|
175
|
-
"@nuxt/schema": "^4.4.
|
|
176
|
-
"@nuxt/test-utils": "^
|
|
175
|
+
"@nuxt/schema": "^4.4.8",
|
|
176
|
+
"@nuxt/test-utils": "^4.0.3",
|
|
177
177
|
"@tailwindcss/forms": "^0.5.11",
|
|
178
|
-
"@tailwindcss/postcss": "^4.
|
|
179
|
-
"@tailwindcss/typography": "^0.5.
|
|
180
|
-
"@tailwindcss/vite": "^4.
|
|
178
|
+
"@tailwindcss/postcss": "^4.3.1",
|
|
179
|
+
"@tailwindcss/typography": "^0.5.20",
|
|
180
|
+
"@tailwindcss/vite": "^4.3.1",
|
|
181
181
|
"@thedutchcoder/postcss-rem-to-px": "^0.0.2",
|
|
182
|
-
"@types/gettext-parser": "^
|
|
182
|
+
"@types/gettext-parser": "^9.0.0",
|
|
183
183
|
"@types/micromatch": "^4.0.10",
|
|
184
|
-
"@types/node": "^25.
|
|
184
|
+
"@types/node": "^25.9.3",
|
|
185
185
|
"@types/papaparse": "^5.5.2",
|
|
186
|
-
"@types/turndown": "^5.0.
|
|
187
|
-
"@vue/test-utils": "^2.4.
|
|
188
|
-
"axe-core": "^4.
|
|
186
|
+
"@types/turndown": "^5.0.6",
|
|
187
|
+
"@vue/test-utils": "^2.4.11",
|
|
188
|
+
"axe-core": "^4.12.1",
|
|
189
189
|
"changelogen": "^0.6.2",
|
|
190
|
-
"ckeditor5": "^48.
|
|
191
|
-
"commander": "^
|
|
192
|
-
"deepl-node": "^1.
|
|
193
|
-
"eslint": "^
|
|
194
|
-
"eslint-plugin-oxlint": "^1.
|
|
195
|
-
"eslint-plugin-sonarjs": "^
|
|
190
|
+
"ckeditor5": "^48.2.0",
|
|
191
|
+
"commander": "^15.0.0",
|
|
192
|
+
"deepl-node": "^1.27.0",
|
|
193
|
+
"eslint": "^10.5.0",
|
|
194
|
+
"eslint-plugin-oxlint": "^1.69.0",
|
|
195
|
+
"eslint-plugin-sonarjs": "^4.0.3",
|
|
196
196
|
"eslint-plugin-tailwindcss": "^4.0.0-beta.0",
|
|
197
|
-
"gettext-parser": "^
|
|
198
|
-
"happy-dom": "^20.
|
|
199
|
-
"nuxt": "^4.4.
|
|
200
|
-
"nuxt-graphql-middleware": "^5.
|
|
197
|
+
"gettext-parser": "^9.0.2",
|
|
198
|
+
"happy-dom": "^20.10.3",
|
|
199
|
+
"nuxt": "^4.4.8",
|
|
200
|
+
"nuxt-graphql-middleware": "^5.4.0",
|
|
201
201
|
"nuxt-svg-icon-sprite": "^2.0.2",
|
|
202
202
|
"openai": "^6.17.0",
|
|
203
|
-
"oxc-parser": "^0.
|
|
204
|
-
"oxc-walker": "^0.
|
|
205
|
-
"oxfmt": "^0.
|
|
206
|
-
"oxlint": "^1.
|
|
207
|
-
"playwright-core": "^1.
|
|
208
|
-
"postcss": "^8.5.
|
|
203
|
+
"oxc-parser": "^0.135.0",
|
|
204
|
+
"oxc-walker": "^1.0.0",
|
|
205
|
+
"oxfmt": "^0.54.0",
|
|
206
|
+
"oxlint": "^1.69.0",
|
|
207
|
+
"playwright-core": "^1.60.0",
|
|
208
|
+
"postcss": "^8.5.15",
|
|
209
209
|
"postcss-cli": "^11.0.1",
|
|
210
210
|
"postcss-import": "^16.1.1",
|
|
211
211
|
"postcss-mixins": "^12.1.2",
|
|
212
212
|
"postcss-nested-import": "^1.3.0",
|
|
213
213
|
"postcss-nesting": "^14.0.0",
|
|
214
214
|
"postcss-replace": "^2.0.1",
|
|
215
|
-
"postcss-selector-parser": "^7.1.
|
|
216
|
-
"postcss-url": "^10.1.
|
|
217
|
-
"prettier": "^3.
|
|
218
|
-
"prettier-plugin-glsl": "^0.2.5",
|
|
215
|
+
"postcss-selector-parser": "^7.1.4",
|
|
216
|
+
"postcss-url": "^10.1.4",
|
|
217
|
+
"prettier": "^3.8.4",
|
|
219
218
|
"syllable": "^5.0.1",
|
|
220
219
|
"tailwindcss": "^4.2.4",
|
|
221
|
-
"tsx": "^4.
|
|
220
|
+
"tsx": "^4.22.4",
|
|
222
221
|
"turndown": "^7.2.4",
|
|
223
|
-
"typescript": "^6.0.
|
|
222
|
+
"typescript": "^6.0.3",
|
|
224
223
|
"unbuild": "^3.6.1",
|
|
225
|
-
"vite-plugin-glsl": "^1.
|
|
224
|
+
"vite-plugin-glsl": "^1.6.0",
|
|
226
225
|
"vitepress": "^2.0.0-alpha.17",
|
|
227
|
-
"vitest": "^
|
|
228
|
-
"vue-router": "^5.0
|
|
229
|
-
"vue-tsc": "^3.
|
|
226
|
+
"vitest": "^4.1.9",
|
|
227
|
+
"vue-router": "^5.1.0",
|
|
228
|
+
"vue-tsc": "^3.3.5"
|
|
230
229
|
},
|
|
231
230
|
"peerDependencies": {
|
|
232
231
|
"@anthropic-ai/sdk": "*",
|
|
@@ -279,21 +278,14 @@
|
|
|
279
278
|
"engines": {
|
|
280
279
|
"node": ">=18.0.0"
|
|
281
280
|
},
|
|
281
|
+
"packageManager": "bun@1.3.14",
|
|
282
|
+
"trustedDependencies": [
|
|
283
|
+
"@parcel/watcher",
|
|
284
|
+
"esbuild",
|
|
285
|
+
"unrs-resolver"
|
|
286
|
+
],
|
|
282
287
|
"overrides": {
|
|
283
288
|
"lodash": "^4.17.24",
|
|
284
|
-
"vue": "^3.5.34"
|
|
285
|
-
"@nuxt/module-builder": {
|
|
286
|
-
"typescript": "$typescript"
|
|
287
|
-
},
|
|
288
|
-
"postcss-url": {
|
|
289
|
-
"minimatch": "^10.2.3"
|
|
290
|
-
},
|
|
291
|
-
"eslint-plugin-sonarjs": {
|
|
292
|
-
"minimatch": "^10.2.3"
|
|
293
|
-
},
|
|
294
|
-
"prettier-plugin-glsl": {
|
|
295
|
-
"chevrotain": "^12.0.0",
|
|
296
|
-
"lodash": "^4.17.24"
|
|
297
|
-
}
|
|
289
|
+
"vue": "^3.5.34"
|
|
298
290
|
}
|
|
299
291
|
}
|