@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
|
@@ -124,11 +124,15 @@ export default defineBlokkliAgentTool({
|
|
|
124
124
|
);
|
|
125
125
|
const entry = {
|
|
126
126
|
type: opt.option.type,
|
|
127
|
-
label:
|
|
127
|
+
label: ctx.app.definitions.resolveDefinitionString(
|
|
128
|
+
opt.option.label
|
|
129
|
+
),
|
|
128
130
|
currentValue: resolvedValue ?? ""
|
|
129
131
|
};
|
|
130
132
|
if (opt.option.description) {
|
|
131
|
-
entry.description =
|
|
133
|
+
entry.description = ctx.app.definitions.resolveDefinitionString(
|
|
134
|
+
opt.option.description
|
|
135
|
+
);
|
|
132
136
|
}
|
|
133
137
|
const labels = extractOptionLabels(opt.option);
|
|
134
138
|
if (labels) {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
-
export declare const paramsSchema: z.
|
|
3
|
-
uuids: z.
|
|
4
|
-
includeNested: z.ZodDefault<z.ZodOptional<z.
|
|
2
|
+
export declare const paramsSchema: z.ZodPreprocess<z.ZodObject<{
|
|
3
|
+
uuids: z.ZodPreprocess<z.ZodArray<z.ZodString>>;
|
|
4
|
+
includeNested: z.ZodDefault<z.ZodOptional<z.ZodPreprocess<z.ZodBoolean>>>;
|
|
5
5
|
}, z.core.$strip>>;
|
|
6
6
|
export declare const resultSchema: z.ZodRecord<z.ZodString, z.ZodRecord<z.ZodString, z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
7
7
|
type: z.ZodLiteral<"plain">;
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
2
|
export declare const paramsSchema: z.ZodObject<{
|
|
3
3
|
uuid: z.ZodString;
|
|
4
|
-
includeParentChain: z.ZodDefault<z.ZodOptional<z.
|
|
5
|
-
includeSiblings: z.ZodDefault<z.ZodOptional<z.
|
|
6
|
-
includeChildren: z.ZodDefault<z.ZodOptional<z.
|
|
7
|
-
includeContentFields: z.ZodDefault<z.ZodOptional<z.
|
|
8
|
-
includeOptions: z.ZodDefault<z.ZodOptional<z.
|
|
4
|
+
includeParentChain: z.ZodDefault<z.ZodOptional<z.ZodPreprocess<z.ZodBoolean>>>;
|
|
5
|
+
includeSiblings: z.ZodDefault<z.ZodOptional<z.ZodPreprocess<z.ZodBoolean>>>;
|
|
6
|
+
includeChildren: z.ZodDefault<z.ZodOptional<z.ZodPreprocess<z.ZodBoolean>>>;
|
|
7
|
+
includeContentFields: z.ZodDefault<z.ZodOptional<z.ZodPreprocess<z.ZodBoolean>>>;
|
|
8
|
+
includeOptions: z.ZodDefault<z.ZodOptional<z.ZodPreprocess<z.ZodBoolean>>>;
|
|
9
9
|
}, z.core.$strip>;
|
|
10
10
|
export declare const resultSchema: z.ZodObject<{
|
|
11
11
|
uuid: z.ZodString;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
2
|
export declare const paramsSchema: z.ZodObject<{
|
|
3
3
|
maxNestingLevel: z.ZodOptional<z.ZodCoercedNumber<unknown>>;
|
|
4
|
-
includeDimensions: z.ZodDefault<z.ZodOptional<z.
|
|
4
|
+
includeDimensions: z.ZodDefault<z.ZodOptional<z.ZodPreprocess<z.ZodBoolean>>>;
|
|
5
5
|
}, z.core.$strip>;
|
|
6
6
|
type BlockDimensions = {
|
|
7
7
|
x: number;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
2
|
export declare const paramsSchema: z.ZodObject<{
|
|
3
|
-
uuids: z.
|
|
3
|
+
uuids: z.ZodPreprocess<z.ZodArray<z.ZodString>>;
|
|
4
4
|
}, z.core.$strip>;
|
|
5
5
|
export declare const resultSchema: z.ZodObject<{
|
|
6
6
|
entities: z.ZodArray<z.ZodObject<{
|
|
@@ -4,11 +4,11 @@ export declare const paramsSchema: z.ZodObject<{
|
|
|
4
4
|
}, z.core.$strip>;
|
|
5
5
|
export declare const resultSchema: z.ZodUnion<readonly [z.ZodObject<{
|
|
6
6
|
type: z.ZodEnum<{
|
|
7
|
+
options: "options";
|
|
7
8
|
rewrite: "rewrite";
|
|
8
9
|
delete: "delete";
|
|
9
10
|
add: "add";
|
|
10
11
|
move: "move";
|
|
11
|
-
options: "options";
|
|
12
12
|
}>;
|
|
13
13
|
label: z.ZodString;
|
|
14
14
|
}, z.core.$strip>, z.ZodObject<{
|
|
@@ -10,11 +10,11 @@ export declare const paramsSchema: z.ZodObject<{
|
|
|
10
10
|
}, z.core.$strip>;
|
|
11
11
|
export declare const resultSchema: z.ZodUnion<readonly [z.ZodObject<{
|
|
12
12
|
type: z.ZodEnum<{
|
|
13
|
+
options: "options";
|
|
13
14
|
rewrite: "rewrite";
|
|
14
15
|
delete: "delete";
|
|
15
16
|
add: "add";
|
|
16
17
|
move: "move";
|
|
17
|
-
options: "options";
|
|
18
18
|
}>;
|
|
19
19
|
label: z.ZodString;
|
|
20
20
|
}, z.core.$strip>, z.ZodObject<{
|
|
@@ -9,11 +9,11 @@ export declare const paramsSchema: z.ZodObject<{
|
|
|
9
9
|
}, z.core.$strip>;
|
|
10
10
|
export declare const resultSchema: z.ZodUnion<readonly [z.ZodObject<{
|
|
11
11
|
type: z.ZodEnum<{
|
|
12
|
+
options: "options";
|
|
12
13
|
rewrite: "rewrite";
|
|
13
14
|
delete: "delete";
|
|
14
15
|
add: "add";
|
|
15
16
|
move: "move";
|
|
16
|
-
options: "options";
|
|
17
17
|
}>;
|
|
18
18
|
label: z.ZodString;
|
|
19
19
|
}, z.core.$strip>, z.ZodObject<{
|
|
@@ -8,11 +8,11 @@ export declare const paramsSchema: z.ZodObject<{
|
|
|
8
8
|
}, z.core.$strip>;
|
|
9
9
|
export declare const resultSchema: z.ZodUnion<readonly [z.ZodObject<{
|
|
10
10
|
type: z.ZodEnum<{
|
|
11
|
+
options: "options";
|
|
11
12
|
rewrite: "rewrite";
|
|
12
13
|
delete: "delete";
|
|
13
14
|
add: "add";
|
|
14
15
|
move: "move";
|
|
15
|
-
options: "options";
|
|
16
16
|
}>;
|
|
17
17
|
label: z.ZodString;
|
|
18
18
|
}, z.core.$strip>, z.ZodObject<{
|
|
@@ -7,11 +7,11 @@ export declare const paramsSchema: z.ZodObject<{
|
|
|
7
7
|
}, z.core.$strip>;
|
|
8
8
|
export declare const resultSchema: z.ZodUnion<readonly [z.ZodObject<{
|
|
9
9
|
type: z.ZodEnum<{
|
|
10
|
+
options: "options";
|
|
10
11
|
rewrite: "rewrite";
|
|
11
12
|
delete: "delete";
|
|
12
13
|
add: "add";
|
|
13
14
|
move: "move";
|
|
14
|
-
options: "options";
|
|
15
15
|
}>;
|
|
16
16
|
label: z.ZodString;
|
|
17
17
|
}, z.core.$strip>, z.ZodObject<{
|
|
@@ -59,7 +59,7 @@ export declare const mutationResultSchema: z.ZodUnion<readonly [z.ZodObject<{
|
|
|
59
59
|
* still advertises an array, so the model is guided toward the array form while
|
|
60
60
|
* a single string is accepted as a fallback.
|
|
61
61
|
*/
|
|
62
|
-
export declare function stringArrayParam(description: string): z.
|
|
62
|
+
export declare function stringArrayParam(description: string): z.ZodPreprocess<z.ZodArray<z.ZodString>>;
|
|
63
63
|
/**
|
|
64
64
|
* Wraps an object params schema to tolerate a singular key when the schema
|
|
65
65
|
* actually expects its plural form (e.g. `uuid` → `uuids`). LLMs — especially
|
|
@@ -71,7 +71,7 @@ export declare function stringArrayParam(description: string): z.ZodPipe<z.ZodTr
|
|
|
71
71
|
* `z.preprocess`), so the model is still guided to the plural form; the
|
|
72
72
|
* singular form is silently accepted as a fallback.
|
|
73
73
|
*/
|
|
74
|
-
export declare function tolerantSingularKeys<T extends z.ZodType>(schema: T, aliases: Record<string, string>): z.
|
|
74
|
+
export declare function tolerantSingularKeys<T extends z.ZodType>(schema: T, aliases: Record<string, string>): z.ZodPreprocess<T>;
|
|
75
75
|
/**
|
|
76
76
|
* Shared schema for option values (used by add_blocks and set_block_options).
|
|
77
77
|
*/
|
|
@@ -7,11 +7,11 @@ export declare const paramsSchema: z.ZodObject<{
|
|
|
7
7
|
}, z.core.$strip>;
|
|
8
8
|
export declare const resultSchema: z.ZodUnion<readonly [z.ZodObject<{
|
|
9
9
|
type: z.ZodEnum<{
|
|
10
|
+
options: "options";
|
|
10
11
|
rewrite: "rewrite";
|
|
11
12
|
delete: "delete";
|
|
12
13
|
add: "add";
|
|
13
14
|
move: "move";
|
|
14
|
-
options: "options";
|
|
15
15
|
}>;
|
|
16
16
|
label: z.ZodString;
|
|
17
17
|
}, z.core.$strip>, z.ZodObject<{
|
|
@@ -5,11 +5,11 @@ export declare const paramsSchema: z.ZodObject<{
|
|
|
5
5
|
}, z.core.$strip>;
|
|
6
6
|
export declare const resultSchema: z.ZodUnion<readonly [z.ZodObject<{
|
|
7
7
|
type: z.ZodEnum<{
|
|
8
|
+
options: "options";
|
|
8
9
|
rewrite: "rewrite";
|
|
9
10
|
delete: "delete";
|
|
10
11
|
add: "add";
|
|
11
12
|
move: "move";
|
|
12
|
-
options: "options";
|
|
13
13
|
}>;
|
|
14
14
|
label: z.ZodString;
|
|
15
15
|
}, z.core.$strip>, z.ZodObject<{
|
|
@@ -6,7 +6,7 @@ declare const operationSchema: z.ZodObject<{
|
|
|
6
6
|
fieldName: z.ZodString;
|
|
7
7
|
search: z.ZodString;
|
|
8
8
|
replace: z.ZodString;
|
|
9
|
-
selector: z.ZodOptional<z.
|
|
9
|
+
selector: z.ZodOptional<z.ZodPreprocess<z.ZodBoolean>>;
|
|
10
10
|
}, z.core.$strip>;
|
|
11
11
|
declare const updateSchema: z.ZodObject<{
|
|
12
12
|
uuid: z.ZodString;
|
|
@@ -24,9 +24,9 @@ export declare const paramsSchema: z.ZodObject<{
|
|
|
24
24
|
fieldName: z.ZodString;
|
|
25
25
|
search: z.ZodString;
|
|
26
26
|
replace: z.ZodString;
|
|
27
|
-
selector: z.ZodOptional<z.
|
|
27
|
+
selector: z.ZodOptional<z.ZodPreprocess<z.ZodBoolean>>;
|
|
28
28
|
}, z.core.$strip>>>;
|
|
29
|
-
requireApproval: z.ZodOptional<z.
|
|
29
|
+
requireApproval: z.ZodOptional<z.ZodPreprocess<z.ZodBoolean>>;
|
|
30
30
|
}, z.core.$strip>;
|
|
31
31
|
export type BatchRewriteParams = z.infer<typeof paramsSchema>;
|
|
32
32
|
export type BatchRewriteResult = z.infer<typeof fieldDiffResultSchema>;
|
|
@@ -24,34 +24,29 @@ export class FieldStreamParser {
|
|
|
24
24
|
}
|
|
25
25
|
this.stripLeadingNewline = false;
|
|
26
26
|
}
|
|
27
|
-
|
|
28
|
-
while (changed) {
|
|
29
|
-
changed = false;
|
|
27
|
+
while (true) {
|
|
30
28
|
const markerPos = this.buffer.indexOf(MARKER_PREFIX);
|
|
31
29
|
if (markerPos === -1) {
|
|
32
|
-
|
|
30
|
+
this.emitBufferedContent(events, this.buffer.length);
|
|
33
31
|
break;
|
|
34
32
|
}
|
|
35
33
|
if (markerPos > 0) {
|
|
36
34
|
const before = this.buffer.slice(0, markerPos);
|
|
37
35
|
this.buffer = this.buffer.slice(markerPos);
|
|
38
36
|
this.appendContent(before, events);
|
|
39
|
-
changed = true;
|
|
40
37
|
continue;
|
|
41
38
|
}
|
|
42
39
|
const matched = this.tryMatchMarker(events);
|
|
43
40
|
if (matched) {
|
|
44
|
-
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
} else {
|
|
52
|
-
break;
|
|
53
|
-
}
|
|
41
|
+
continue;
|
|
42
|
+
}
|
|
43
|
+
if (this.buffer.length >= MAX_MARKER_LENGTH) {
|
|
44
|
+
const chunk = this.buffer.slice(0, 3);
|
|
45
|
+
this.buffer = this.buffer.slice(3);
|
|
46
|
+
this.appendContent(chunk, events);
|
|
47
|
+
continue;
|
|
54
48
|
}
|
|
49
|
+
break;
|
|
55
50
|
}
|
|
56
51
|
return events;
|
|
57
52
|
}
|
|
@@ -19,21 +19,21 @@ import { z } from 'zod';
|
|
|
19
19
|
* or `.default()` on the result would degrade to `any` in the published `.d.ts`
|
|
20
20
|
* — use {@link optionalBooleanParam} / {@link booleanParamWithDefault} instead.
|
|
21
21
|
*/
|
|
22
|
-
export declare function booleanParam(description: string): z.
|
|
22
|
+
export declare function booleanParam(description: string): z.ZodPreprocess<z.ZodBoolean>;
|
|
23
23
|
/**
|
|
24
24
|
* Optional variant of {@link booleanParam}. Use instead of
|
|
25
25
|
* `booleanParam(...).optional()` so isolated-declaration emit can preserve the
|
|
26
26
|
* type — chained Zod method calls aren't resolvable by mkdist's per-file
|
|
27
27
|
* declaration emit and collapse to `any` in the published `.d.ts`.
|
|
28
28
|
*/
|
|
29
|
-
export declare function optionalBooleanParam(description: string): z.ZodOptional<z.
|
|
29
|
+
export declare function optionalBooleanParam(description: string): z.ZodOptional<z.ZodPreprocess<z.ZodBoolean>>;
|
|
30
30
|
/**
|
|
31
31
|
* Optional boolean with a default. Use instead of
|
|
32
32
|
* `booleanParam(...).optional().default(value)` so isolated-declaration emit
|
|
33
33
|
* can preserve the type. The default value applies when the param is omitted
|
|
34
34
|
* or `undefined` at parse time.
|
|
35
35
|
*/
|
|
36
|
-
export declare function booleanParamWithDefault(description: string, defaultValue: boolean): z.ZodDefault<z.ZodOptional<z.
|
|
36
|
+
export declare function booleanParamWithDefault(description: string, defaultValue: boolean): z.ZodDefault<z.ZodOptional<z.ZodPreprocess<z.ZodBoolean>>>;
|
|
37
37
|
/**
|
|
38
38
|
* Coerce double-serialized array/object params back to their real values.
|
|
39
39
|
*
|
|
@@ -207,7 +207,6 @@ export type PageContext = {
|
|
|
207
207
|
* Both Anthropic and OpenAI SDKs map to these via HTTP status codes.
|
|
208
208
|
*/
|
|
209
209
|
export declare const agentErrorTypeSchema: z.ZodEnum<{
|
|
210
|
-
unknown: "unknown";
|
|
211
210
|
authentication: "authentication";
|
|
212
211
|
rate_limit: "rate_limit";
|
|
213
212
|
overloaded: "overloaded";
|
|
@@ -215,6 +214,7 @@ export declare const agentErrorTypeSchema: z.ZodEnum<{
|
|
|
215
214
|
bad_request: "bad_request";
|
|
216
215
|
connection: "connection";
|
|
217
216
|
unauthorized: "unauthorized";
|
|
217
|
+
unknown: "unknown";
|
|
218
218
|
}>;
|
|
219
219
|
export type AgentErrorType = z.infer<typeof agentErrorTypeSchema>;
|
|
220
220
|
/**
|
|
@@ -355,8 +355,8 @@ export declare const clientMessageSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
355
355
|
name: z.ZodString;
|
|
356
356
|
label: z.ZodString;
|
|
357
357
|
type: z.ZodEnum<{
|
|
358
|
-
link: "link";
|
|
359
358
|
reference: "reference";
|
|
359
|
+
link: "link";
|
|
360
360
|
}>;
|
|
361
361
|
allowed: z.ZodArray<z.ZodObject<{
|
|
362
362
|
type: z.ZodString;
|
|
@@ -395,8 +395,8 @@ export declare const clientMessageSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
395
395
|
name: z.ZodString;
|
|
396
396
|
label: z.ZodString;
|
|
397
397
|
type: z.ZodEnum<{
|
|
398
|
-
link: "link";
|
|
399
398
|
reference: "reference";
|
|
399
|
+
link: "link";
|
|
400
400
|
}>;
|
|
401
401
|
allowed: z.ZodArray<z.ZodObject<{
|
|
402
402
|
type: z.ZodString;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { B as BlokkliModule } from '../../shared/editor.
|
|
1
|
+
import { B as BlokkliModule } from '../../shared/editor.BDyiQvbV.mjs';
|
|
2
2
|
import 'nuxt/schema';
|
|
3
3
|
import 'consola';
|
|
4
4
|
import '../../../dist/global/types/definitions.js';
|
|
@@ -14,6 +14,19 @@ type ChartsModuleOptions = {
|
|
|
14
14
|
* @todo not yet implemented
|
|
15
15
|
*/
|
|
16
16
|
chartRenderComponent?: string;
|
|
17
|
+
/**
|
|
18
|
+
* Number format settings for the chart editor.
|
|
19
|
+
*/
|
|
20
|
+
numberFormat?: {
|
|
21
|
+
/**
|
|
22
|
+
* Override the locales offered in the number-format editor.
|
|
23
|
+
*
|
|
24
|
+
* Provide an array of BCP-47 locale ids (e.g. `['de-CH', 'en-US']`) to
|
|
25
|
+
* restrict the selectable locales. When omitted, blökkli ships a default
|
|
26
|
+
* set. The label for each locale is derived automatically from its id.
|
|
27
|
+
*/
|
|
28
|
+
locales?: string[];
|
|
29
|
+
};
|
|
17
30
|
};
|
|
18
31
|
|
|
19
32
|
declare const _default: (options?: ChartsModuleOptions | undefined) => BlokkliModule<ChartsModuleOptions>;
|
|
@@ -3,7 +3,7 @@ import { defineBlokkliModule } from '../index.mjs';
|
|
|
3
3
|
import { fileURLToPath } from 'node:url';
|
|
4
4
|
import * as path from 'node:path';
|
|
5
5
|
import * as fs from 'node:fs';
|
|
6
|
-
import { C as Collector, a as CollectedFile,
|
|
6
|
+
import { C as Collector, a as CollectedFile, b as extractFirstStringArg } from '../../shared/editor.BGemL1Oh.mjs';
|
|
7
7
|
import { d as defineCodeTemplate } from '../../shared/editor.6D5vApr0.mjs';
|
|
8
8
|
import 'typescript';
|
|
9
9
|
import 'oxc-walker';
|
|
@@ -223,6 +223,31 @@ export const chartTypeIllustrations: Partial<Record<ChartTypeId, Component>>
|
|
|
223
223
|
);
|
|
224
224
|
}
|
|
225
225
|
|
|
226
|
+
const DEFAULT_NUMBER_FORMAT_LOCALES = [
|
|
227
|
+
"de-CH",
|
|
228
|
+
"fr-CH",
|
|
229
|
+
"it-CH",
|
|
230
|
+
"de-DE",
|
|
231
|
+
"en-US",
|
|
232
|
+
"en-GB",
|
|
233
|
+
"fr-FR"
|
|
234
|
+
];
|
|
235
|
+
function createConfigTemplate(options) {
|
|
236
|
+
const numberFormatLocales = options?.numberFormat?.locales ?? DEFAULT_NUMBER_FORMAT_LOCALES;
|
|
237
|
+
return defineCodeTemplate(
|
|
238
|
+
"charts-config",
|
|
239
|
+
() => `export const chartsConfig = {
|
|
240
|
+
numberFormatLocales: ${JSON.stringify(numberFormatLocales)},
|
|
241
|
+
}
|
|
242
|
+
`,
|
|
243
|
+
() => `export const chartsConfig: {
|
|
244
|
+
numberFormatLocales: string[]
|
|
245
|
+
}
|
|
246
|
+
`,
|
|
247
|
+
{ write: true }
|
|
248
|
+
);
|
|
249
|
+
}
|
|
250
|
+
|
|
226
251
|
const resolve = createResolver(
|
|
227
252
|
fileURLToPath(new URL("./", import.meta.url))
|
|
228
253
|
).resolve;
|
|
@@ -231,7 +256,16 @@ const index = defineBlokkliModule({
|
|
|
231
256
|
options.blokkliDirs ??= [];
|
|
232
257
|
options.blokkliDirs.push(resolve("./runtime/blokkli"));
|
|
233
258
|
},
|
|
234
|
-
setup({ context, helper, $t }) {
|
|
259
|
+
setup({ context, helper, $t }, options) {
|
|
260
|
+
helper.addPackageDependency(
|
|
261
|
+
"echarts/core",
|
|
262
|
+
"echarts/renderers",
|
|
263
|
+
"echarts/charts",
|
|
264
|
+
"echarts/components",
|
|
265
|
+
"vue-echarts",
|
|
266
|
+
"json5",
|
|
267
|
+
"zod"
|
|
268
|
+
);
|
|
235
269
|
helper.addAlias("#blokkli/charts/types", resolve("./runtime/types"));
|
|
236
270
|
helper.addAlias(
|
|
237
271
|
"#blokkli/charts/definition",
|
|
@@ -261,6 +295,7 @@ const index = defineBlokkliModule({
|
|
|
261
295
|
context.addTemplate(createDefinitionsTemplate(chartTypes));
|
|
262
296
|
context.addTemplate(createComponentsTemplate(chartTypes));
|
|
263
297
|
context.addTemplate(createIllustrationsTemplate(chartTypes));
|
|
298
|
+
context.addTemplate(createConfigTemplate(options));
|
|
264
299
|
helper.addAppTsInclude(projectChartsDir);
|
|
265
300
|
for (const dir of moduleBlokkliDirs) {
|
|
266
301
|
helper.addAppTsInclude(path.join(dir, "chart-types"));
|
|
@@ -121,7 +121,7 @@ function openExamples() {
|
|
|
121
121
|
}
|
|
122
122
|
</script>
|
|
123
123
|
|
|
124
|
-
<style>/*! tailwindcss v4.
|
|
124
|
+
<style>/*! tailwindcss v4.3.1 | MIT License | https://tailwindcss.com */
|
|
125
125
|
.bk-advanced-config-error {
|
|
126
126
|
border-radius: 4px;
|
|
127
127
|
border-style: var(--bk-tw-border-style);
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<FormToggle
|
|
3
3
|
v-if="option.type === 'checkbox'"
|
|
4
|
-
:label
|
|
5
|
-
:description
|
|
4
|
+
:label
|
|
5
|
+
:description
|
|
6
6
|
:model-value="!!(value ?? option.default)"
|
|
7
7
|
@update:model-value="$emit('update', $event)"
|
|
8
8
|
/>
|
|
9
9
|
<FormRadio
|
|
10
10
|
v-else-if="option.type === 'radios'"
|
|
11
11
|
:id="`chart-option-${optionKey}`"
|
|
12
|
-
:label
|
|
13
|
-
:description
|
|
12
|
+
:label
|
|
13
|
+
:description
|
|
14
14
|
inline
|
|
15
15
|
:options="radioOptions"
|
|
16
16
|
:model-value="String(value ?? option.default ?? '')"
|
|
@@ -19,8 +19,8 @@
|
|
|
19
19
|
<FormNumber
|
|
20
20
|
v-else-if="option.type === 'number'"
|
|
21
21
|
:id="`chart-option-${optionKey}`"
|
|
22
|
-
:label
|
|
23
|
-
:description
|
|
22
|
+
:label
|
|
23
|
+
:description
|
|
24
24
|
:min="numberMin"
|
|
25
25
|
:max="numberMax"
|
|
26
26
|
:nullable="option.nullable"
|
|
@@ -31,8 +31,8 @@
|
|
|
31
31
|
<FormText
|
|
32
32
|
v-else-if="option.type === 'text'"
|
|
33
33
|
:id="`chart-option-${optionKey}`"
|
|
34
|
-
:label
|
|
35
|
-
:description
|
|
34
|
+
:label
|
|
35
|
+
:description
|
|
36
36
|
:model-value="String(value ?? option.default ?? '')"
|
|
37
37
|
lazy
|
|
38
38
|
@update:model-value="$emit('update', $event ?? '')"
|
|
@@ -40,7 +40,7 @@
|
|
|
40
40
|
</template>
|
|
41
41
|
|
|
42
42
|
<script setup>
|
|
43
|
-
import { computed } from "#imports";
|
|
43
|
+
import { computed, useBlokkli } from "#imports";
|
|
44
44
|
import {
|
|
45
45
|
FormToggle,
|
|
46
46
|
FormRadio,
|
|
@@ -53,6 +53,16 @@ const props = defineProps({
|
|
|
53
53
|
value: { type: null, required: true }
|
|
54
54
|
});
|
|
55
55
|
defineEmits(["update"]);
|
|
56
|
+
const { definitions } = useBlokkli();
|
|
57
|
+
const label = computed(() => {
|
|
58
|
+
return definitions.resolveDefinitionString(props.option.label);
|
|
59
|
+
});
|
|
60
|
+
const description = computed(() => {
|
|
61
|
+
if (props.option.description) {
|
|
62
|
+
return definitions.resolveDefinitionString(props.option.description);
|
|
63
|
+
}
|
|
64
|
+
return void 0;
|
|
65
|
+
});
|
|
56
66
|
const radioOptions = computed(() => {
|
|
57
67
|
if (props.option.type !== "radios") {
|
|
58
68
|
return [];
|
package/dist/modules/charts/runtime/features/charts/Editor/CsvImport/OutputPreviewTable/index.vue
CHANGED
|
@@ -102,7 +102,7 @@ function onDragEnd() {
|
|
|
102
102
|
}
|
|
103
103
|
</script>
|
|
104
104
|
|
|
105
|
-
<style>/*! tailwindcss v4.
|
|
105
|
+
<style>/*! tailwindcss v4.3.1 | MIT License | https://tailwindcss.com */
|
|
106
106
|
.bk-csv-preview-table th,.bk-csv-preview-table td {
|
|
107
107
|
border-right-style: var(--bk-tw-border-style);
|
|
108
108
|
border-right-width: 1px;
|
|
@@ -10,11 +10,15 @@
|
|
|
10
10
|
<th />
|
|
11
11
|
<th v-for="(s, si) in series" :key="si">
|
|
12
12
|
<div class="bk-chart-data-table-series-header">
|
|
13
|
-
<
|
|
13
|
+
<span
|
|
14
14
|
v-if="hasSeriesColors"
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
15
|
+
class="_bk_contents"
|
|
16
|
+
>
|
|
17
|
+
<ColorDropdown
|
|
18
|
+
:color-id="s.color"
|
|
19
|
+
@select="updateSeriesColor(si, $event)"
|
|
20
|
+
/>
|
|
21
|
+
</span>
|
|
18
22
|
<input
|
|
19
23
|
type="text"
|
|
20
24
|
:value="s.name"
|
|
@@ -52,11 +56,15 @@
|
|
|
52
56
|
<tr v-for="(cat, ci) in categories" :key="ci">
|
|
53
57
|
<td>
|
|
54
58
|
<div class="bk-chart-data-table-category-cell">
|
|
55
|
-
<
|
|
59
|
+
<span
|
|
56
60
|
v-if="hasCategoryColors"
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
61
|
+
class="_bk_contents"
|
|
62
|
+
>
|
|
63
|
+
<ColorDropdown
|
|
64
|
+
:color-id="categoryColors[ci] || ''"
|
|
65
|
+
@select="updateCategoryColor(ci, $event)"
|
|
66
|
+
/>
|
|
67
|
+
</span>
|
|
60
68
|
<input
|
|
61
69
|
type="text"
|
|
62
70
|
class="bk-chart-data-table-input _bk_font-semibold"
|
|
@@ -69,6 +69,7 @@ import { computed, useBlokkli } from "#imports";
|
|
|
69
69
|
import { createNumberFormatter } from "../../../../helpers/numberFormat";
|
|
70
70
|
import { FormSelect, FormText, FormRadio } from "#blokkli/editor/components";
|
|
71
71
|
import PanelSection from "#blokkli/editor/components/Panel/Section/index.vue";
|
|
72
|
+
import { chartsConfig } from "#blokkli-build/charts-config";
|
|
72
73
|
const { $t } = useBlokkli();
|
|
73
74
|
const props = defineProps({
|
|
74
75
|
format: { type: Object, required: true }
|
|
@@ -83,15 +84,30 @@ function update(key, value) {
|
|
|
83
84
|
}
|
|
84
85
|
emit("update:format", next);
|
|
85
86
|
}
|
|
87
|
+
function deriveLocaleLabel(id) {
|
|
88
|
+
let name = id;
|
|
89
|
+
try {
|
|
90
|
+
name = new Intl.DisplayNames([id], {
|
|
91
|
+
type: "language",
|
|
92
|
+
languageDisplay: "standard"
|
|
93
|
+
}).of(id) ?? id;
|
|
94
|
+
} catch {
|
|
95
|
+
}
|
|
96
|
+
try {
|
|
97
|
+
const example = new Intl.NumberFormat(id, {
|
|
98
|
+
minimumFractionDigits: 2
|
|
99
|
+
}).format(1234.5);
|
|
100
|
+
return `${name} \u2014 ${example}`;
|
|
101
|
+
} catch {
|
|
102
|
+
return name;
|
|
103
|
+
}
|
|
104
|
+
}
|
|
86
105
|
const localeOptions = computed(() => [
|
|
87
106
|
{ value: "", label: $t("chartsNumberFormatLocaleAuto", "Auto (browser)") },
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
{ value: "en-US", label: "English (US) \u2014 1,234.50" },
|
|
93
|
-
{ value: "en-GB", label: "English (UK) \u2014 1,234.50" },
|
|
94
|
-
{ value: "fr-FR", label: "Fran\xE7ais (France) \u2014 1 234,50" }
|
|
107
|
+
...chartsConfig.numberFormatLocales.map((id) => ({
|
|
108
|
+
value: id,
|
|
109
|
+
label: deriveLocaleLabel(id)
|
|
110
|
+
}))
|
|
95
111
|
]);
|
|
96
112
|
const decimalsOptions = computed(() => [
|
|
97
113
|
{ value: "", label: $t("auto", "Auto") },
|
|
@@ -239,9 +239,11 @@ import "#blokkli/charts/adapter";
|
|
|
239
239
|
import {
|
|
240
240
|
categoriesAreDates,
|
|
241
241
|
categoriesAreNumeric,
|
|
242
|
+
getColorIdAtIndex,
|
|
242
243
|
getDefaultChartData,
|
|
243
244
|
getFirstColorId
|
|
244
245
|
} from "../../../helpers";
|
|
246
|
+
import { isColorIdValid } from "#blokkli/helpers/colors";
|
|
245
247
|
import { getChartType, getDefaultTypeOptions } from "../../../chart-types";
|
|
246
248
|
import { useChartEditorState } from "./useChartEditorState";
|
|
247
249
|
import { useChartDataSourcePreview } from "./useChartDataSourcePreview";
|
|
@@ -283,24 +285,21 @@ function getCurrentData() {
|
|
|
283
285
|
const hasSeries = Array.isArray(parsed?.series) && parsed.series.length > 0;
|
|
284
286
|
if (parsed && (isAdvanced2 || hasSeries)) {
|
|
285
287
|
if (!isAdvanced2) {
|
|
286
|
-
const validIds = new Set(colorOptions.map((c) => c.id));
|
|
287
288
|
const fallbackId = getFirstColorId(colorOptions);
|
|
288
289
|
for (const series of parsed.series) {
|
|
289
|
-
if (!
|
|
290
|
+
if (!isColorIdValid(series.color, colorOptions)) {
|
|
290
291
|
series.color = fallbackId;
|
|
291
292
|
}
|
|
292
293
|
}
|
|
293
294
|
if (Array.isArray(parsed.categoryColors)) {
|
|
294
295
|
for (let i = 0; i < parsed.categoryColors.length; i++) {
|
|
295
|
-
if (!
|
|
296
|
+
if (!isColorIdValid(parsed.categoryColors[i], colorOptions)) {
|
|
296
297
|
parsed.categoryColors[i] = fallbackId;
|
|
297
298
|
}
|
|
298
299
|
}
|
|
299
300
|
} else {
|
|
300
301
|
parsed.categoryColors = parsed.categories.map(
|
|
301
|
-
(_, i) =>
|
|
302
|
-
return colorOptions[i % colorOptions.length]?.id || fallbackId;
|
|
303
|
-
}
|
|
302
|
+
(_, i) => getColorIdAtIndex(i, colorOptions)
|
|
304
303
|
);
|
|
305
304
|
}
|
|
306
305
|
} else {
|