@book.dev/ui 1.60.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/dist/EmojiGrid-xK5mPJPo.js +205 -0
- package/dist/blockeditor/BlockEditor.d.ts +68 -0
- package/dist/blockeditor/CodeBlockView.d.ts +19 -0
- package/dist/blockeditor/InlineToolbar.d.ts +18 -0
- package/dist/blockeditor/LinkPicker.d.ts +16 -0
- package/dist/blockeditor/MentionMenu.d.ts +14 -0
- package/dist/blockeditor/PresentBlocks.d.ts +21 -0
- package/dist/blockeditor/RichTextEditor.d.ts +29 -0
- package/dist/blockeditor/SlashMenu.d.ts +49 -0
- package/dist/blockeditor/TextBlockView.d.ts +9 -0
- package/dist/blockeditor/__tests__/LinkPicker.test.d.ts +1 -0
- package/dist/blockeditor/__tests__/SlashMenu.test.d.ts +1 -0
- package/dist/blockeditor/__tests__/aiApply.test.d.ts +1 -0
- package/dist/blockeditor/__tests__/groupLock.test.d.ts +1 -0
- package/dist/blockeditor/__tests__/highlight.test.d.ts +1 -0
- package/dist/blockeditor/__tests__/mergeUp.test.d.ts +1 -0
- package/dist/blockeditor/__tests__/present.test.d.ts +1 -0
- package/dist/blockeditor/aiBlocks.d.ts +9 -0
- package/dist/blockeditor/colors.d.ts +23 -0
- package/dist/blockeditor/exportBlocks.d.ts +25 -0
- package/dist/blockeditor/highlight.d.ts +25 -0
- package/dist/blockeditor/index.d.ts +8 -0
- package/dist/blockeditor/kit/KitFrame.d.ts +95 -0
- package/dist/blockeditor/kit/KitSettings.d.ts +18 -0
- package/dist/blockeditor/kit/OptionsEditor.d.ts +8 -0
- package/dist/blockeditor/kit/__tests__/chartMath.test.d.ts +1 -0
- package/dist/blockeditor/kit/__tests__/dataflow.test.d.ts +1 -0
- package/dist/blockeditor/kit/__tests__/exportKit.test.d.ts +1 -0
- package/dist/blockeditor/kit/__tests__/exportKit2.test.d.ts +1 -0
- package/dist/blockeditor/kit/__tests__/groupSync.test.d.ts +1 -0
- package/dist/blockeditor/kit/__tests__/inputs2Render.test.d.ts +1 -0
- package/dist/blockeditor/kit/__tests__/inputs2Scope.test.d.ts +1 -0
- package/dist/blockeditor/kit/__tests__/inputsRender.test.d.ts +1 -0
- package/dist/blockeditor/kit/__tests__/kitConfig.test.d.ts +1 -0
- package/dist/blockeditor/kit/__tests__/kitPanel.test.d.ts +1 -0
- package/dist/blockeditor/kit/__tests__/options.test.d.ts +1 -0
- package/dist/blockeditor/kit/__tests__/scope.test.d.ts +1 -0
- package/dist/blockeditor/kit/cards.d.ts +51 -0
- package/dist/blockeditor/kit/chartMath.d.ts +62 -0
- package/dist/blockeditor/kit/charts.d.ts +27 -0
- package/dist/blockeditor/kit/completion.d.ts +45 -0
- package/dist/blockeditor/kit/dataflow.d.ts +68 -0
- package/dist/blockeditor/kit/groupSync.d.ts +23 -0
- package/dist/blockeditor/kit/index.d.ts +11 -0
- package/dist/blockeditor/kit/inputs.d.ts +135 -0
- package/dist/blockeditor/kit/inputs2.d.ts +86 -0
- package/dist/blockeditor/kit/kitConfig.d.ts +5 -0
- package/dist/blockeditor/kit/kitPanel.d.ts +31 -0
- package/dist/blockeditor/kit/lock.d.ts +12 -0
- package/dist/blockeditor/kit/options.d.ts +60 -0
- package/dist/blockeditor/kit/progress.d.ts +20 -0
- package/dist/blockeditor/kit/scope.d.ts +100 -0
- package/dist/blockeditor/model.d.ts +236 -0
- package/dist/blockeditor/present.d.ts +18 -0
- package/dist/blockeditor/provider.d.ts +16 -0
- package/dist/blockeditor/reactiveBlocks.d.ts +2 -0
- package/dist/blockeditor/registry.d.ts +38 -0
- package/dist/blockeditor/richtext.d.ts +48 -0
- package/dist/blockeditor/useBlockEditor.d.ts +45 -0
- package/dist/components/AboutDialog.d.ts +9 -0
- package/dist/components/AgentPanel.d.ts +2 -0
- package/dist/components/AiBridgeHost.d.ts +14 -0
- package/dist/components/AiSearchDialog.d.ts +8 -0
- package/dist/components/AiSettings.d.ts +7 -0
- package/dist/components/AppearanceSettings.d.ts +3 -0
- package/dist/components/BackForwardCluster.d.ts +1 -0
- package/dist/components/BackupSettings.d.ts +2 -0
- package/dist/components/BreadcrumbCluster.d.ts +1 -0
- package/dist/components/ColorSchemeMenu.d.ts +1 -0
- package/dist/components/CommandMenu.d.ts +1 -0
- package/dist/components/CommandToggle.d.ts +3 -0
- package/dist/components/DocumentArea.d.ts +8 -0
- package/dist/components/Drawer.d.ts +7 -0
- package/dist/components/EmojiGrid.d.ts +16 -0
- package/dist/components/EmojiPickerHost.d.ts +8 -0
- package/dist/components/ExtensionsSettings.d.ts +7 -0
- package/dist/components/FavoritesNav.d.ts +8 -0
- package/dist/components/GeneralSettings.d.ts +2 -0
- package/dist/components/GlobalShortcuts.d.ts +9 -0
- package/dist/components/HomeButton.d.ts +2 -0
- package/dist/components/IconPicker.d.ts +17 -0
- package/dist/components/NavBar.d.ts +1 -0
- package/dist/components/NavContextMenu.d.ts +7 -0
- package/dist/components/PageActionsCluster.d.ts +9 -0
- package/dist/components/PageAppearanceHost.d.ts +9 -0
- package/dist/components/PageContextMenu.d.ts +17 -0
- package/dist/components/PageCover.d.ts +18 -0
- package/dist/components/PageHeaderControls.d.ts +13 -0
- package/dist/components/PageIcon.d.ts +16 -0
- package/dist/components/PageProperties.d.ts +53 -0
- package/dist/components/PluginBoot.d.ts +2 -0
- package/dist/components/PresentMode.d.ts +7 -0
- package/dist/components/ProfileAvatar.d.ts +17 -0
- package/dist/components/ProfileMenu.d.ts +6 -0
- package/dist/components/Settings.d.ts +7 -0
- package/dist/components/SettingsButton.d.ts +2 -0
- package/dist/components/SettingsPanel.d.ts +14 -0
- package/dist/components/SideNav.d.ts +1 -0
- package/dist/components/SideNavToggle.d.ts +3 -0
- package/dist/components/SidebarSections.d.ts +17 -0
- package/dist/components/SplitPane.d.ts +9 -0
- package/dist/components/TemplateGallery.d.ts +8 -0
- package/dist/components/TitlebarTabs.d.ts +10 -0
- package/dist/components/TrashDialog.d.ts +7 -0
- package/dist/components/WindowActionsCluster.d.ts +6 -0
- package/dist/components/WindowControls.d.ts +6 -0
- package/dist/components/WindowTitle.d.ts +7 -0
- package/dist/components/WorkspaceInfo.d.ts +6 -0
- package/dist/components/WorkspaceNavigationTree.d.ts +14 -0
- package/dist/components/WorkspaceSelectMenu.d.ts +10 -0
- package/dist/components/__tests__/AppearanceSettings.test.d.ts +1 -0
- package/dist/components/__tests__/PageIcon.test.d.ts +1 -0
- package/dist/components/__tests__/SettingsPanel.test.d.ts +1 -0
- package/dist/components/__tests__/buildTree.test.d.ts +1 -0
- package/dist/components/__tests__/profileAvatar.test.d.ts +1 -0
- package/dist/components/appearance/AppearanceControls.d.ts +33 -0
- package/dist/components/appearance/PageCustomiseBody.d.ts +29 -0
- package/dist/components/brand/OpenBookLogo.d.ts +11 -0
- package/dist/components/brand/index.d.ts +1 -0
- package/dist/components/database/DatabaseCard.d.ts +36 -0
- package/dist/components/database/DatabasePicker.d.ts +12 -0
- package/dist/components/database/DatabaseRowProperties.d.ts +13 -0
- package/dist/components/database/DatabaseView.d.ts +9 -0
- package/dist/components/database/InlineDatabaseBlock.d.ts +3 -0
- package/dist/components/database/__tests__/InlineDatabaseBlock.test.d.ts +1 -0
- package/dist/components/database/databaseCells.d.ts +57 -0
- package/dist/components/database/databaseCharts.d.ts +28 -0
- package/dist/components/database/databaseColors.d.ts +12 -0
- package/dist/components/database/databaseGraph.d.ts +16 -0
- package/dist/components/database/databaseLayouts.d.ts +84 -0
- package/dist/components/database/databaseMap.d.ts +21 -0
- package/dist/components/database/databaseMapLeaflet.d.ts +26 -0
- package/dist/components/database/databaseMenus.d.ts +97 -0
- package/dist/components/database/databaseTimeline.d.ts +27 -0
- package/dist/components/database/geocode.d.ts +24 -0
- package/dist/components/database/useDatabase.d.ts +129 -0
- package/dist/components/index.d.ts +12 -0
- package/dist/components/review/BlockReviewMarkers.d.ts +19 -0
- package/dist/components/review/CommentThread.d.ts +20 -0
- package/dist/components/review/ReviewPaneBody.d.ts +12 -0
- package/dist/components/review/SuggestHost.d.ts +13 -0
- package/dist/components/review/SuggestionCard.d.ts +21 -0
- package/dist/components/review/__tests__/review.test.d.ts +1 -0
- package/dist/components/review/useReview.d.ts +27 -0
- package/dist/components/settings/AccountSettings.d.ts +6 -0
- package/dist/components/settings/AdminSettings.d.ts +2 -0
- package/dist/components/settings/ConnectionSettings.d.ts +7 -0
- package/dist/components/settings/CustomisationSettings.d.ts +2 -0
- package/dist/components/settings/ProfileSettings.d.ts +2 -0
- package/dist/components/settings/primitives.d.ts +47 -0
- package/dist/components/settings/stubs.d.ts +8 -0
- package/dist/components/ui/__tests__/kbd.test.d.ts +1 -0
- package/dist/components/ui/__tests__/markdown.test.d.ts +1 -0
- package/dist/components/ui/__tests__/select.test.d.ts +1 -0
- package/dist/components/ui/badge.d.ts +9 -0
- package/dist/components/ui/button.d.ts +11 -0
- package/dist/components/ui/command.d.ts +86 -0
- package/dist/components/ui/context-menu.d.ts +24 -0
- package/dist/components/ui/dialog.d.ts +18 -0
- package/dist/components/ui/dropdown-menu.d.ts +27 -0
- package/dist/components/ui/icon-button.d.ts +16 -0
- package/dist/components/ui/input.d.ts +9 -0
- package/dist/components/ui/kbd.d.ts +31 -0
- package/dist/components/ui/label.d.ts +5 -0
- package/dist/components/ui/markdown.d.ts +19 -0
- package/dist/components/ui/navigation-menu.d.ts +12 -0
- package/dist/components/ui/popover.d.ts +6 -0
- package/dist/components/ui/scroll-area.d.ts +5 -0
- package/dist/components/ui/select.d.ts +42 -0
- package/dist/components/ui/skeleton.d.ts +6 -0
- package/dist/components/ui/switch.d.ts +4 -0
- package/dist/components/ui/tooltip.d.ts +7 -0
- package/dist/components/ui/tree.d.ts +37 -0
- package/dist/components/useAppCommands.d.ts +25 -0
- package/dist/data/DataProvider.d.ts +30 -0
- package/dist/data/index.d.ts +1 -0
- package/dist/databaseMapLeaflet-8LYcHcR6.js +87 -0
- package/dist/export/__tests__/chartNormalize.test.d.ts +1 -0
- package/dist/export/__tests__/export.test.d.ts +1 -0
- package/dist/export/__tests__/exportReactive.test.d.ts +1 -0
- package/dist/export/chartNormalize.d.ts +22 -0
- package/dist/export/chartSvg.d.ts +2 -0
- package/dist/export/documentModel.d.ts +136 -0
- package/dist/export/exportSite.d.ts +40 -0
- package/dist/export/format.d.ts +2 -0
- package/dist/export/kitChart.d.ts +21 -0
- package/dist/export/toHtml.d.ts +25 -0
- package/dist/export/toMarkdown.d.ts +7 -0
- package/dist/export/toPdf.d.ts +14 -0
- package/dist/exportBlocks-33D7P_8Q.js +987 -0
- package/dist/exportSite-DlRm4u7W.js +50 -0
- package/dist/format-CLQoRoYP.js +1646 -0
- package/dist/i18n/__tests__/i18n.test.d.ts +1 -0
- package/dist/i18n/index.d.ts +24 -0
- package/dist/i18n/messages/de.d.ts +2 -0
- package/dist/i18n/messages/en.d.ts +977 -0
- package/dist/i18n/messages/ja.d.ts +2 -0
- package/dist/i18n/messages/zh.d.ts +2 -0
- package/dist/index.d.ts +11 -0
- package/dist/index.js +20915 -0
- package/dist/layouts/DefaultLayout.d.ts +4 -0
- package/dist/layouts/index.d.ts +1 -0
- package/dist/lib/__tests__/accountClient.test.d.ts +1 -0
- package/dist/lib/__tests__/backlinks.test.d.ts +1 -0
- package/dist/lib/__tests__/backupBundle.test.d.ts +1 -0
- package/dist/lib/__tests__/blockExport.test.d.ts +1 -0
- package/dist/lib/__tests__/blockModel.test.d.ts +1 -0
- package/dist/lib/__tests__/databaseFormula.test.d.ts +1 -0
- package/dist/lib/__tests__/databaseTypes.test.d.ts +1 -0
- package/dist/lib/__tests__/favorites.test.d.ts +1 -0
- package/dist/lib/__tests__/homePage.test.d.ts +1 -0
- package/dist/lib/__tests__/hud.test.d.ts +1 -0
- package/dist/lib/__tests__/icons.test.d.ts +1 -0
- package/dist/lib/__tests__/mixedContent.test.d.ts +1 -0
- package/dist/lib/__tests__/pageAppearance.test.d.ts +1 -0
- package/dist/lib/__tests__/pageIcon.test.d.ts +1 -0
- package/dist/lib/__tests__/pageLayout.test.d.ts +1 -0
- package/dist/lib/__tests__/pageSaveStatus.test.d.ts +1 -0
- package/dist/lib/__tests__/pageTheme.test.d.ts +1 -0
- package/dist/lib/__tests__/parentGrouping.test.d.ts +1 -0
- package/dist/lib/__tests__/pluginSdk.test.d.ts +1 -0
- package/dist/lib/__tests__/recents.test.d.ts +1 -0
- package/dist/lib/__tests__/relations.test.d.ts +1 -0
- package/dist/lib/__tests__/templates.test.d.ts +1 -0
- package/dist/lib/__tests__/textMerge.test.d.ts +1 -0
- package/dist/lib/__tests__/themes.test.d.ts +1 -0
- package/dist/lib/__tests__/treeMove.test.d.ts +1 -0
- package/dist/lib/aiBridge.d.ts +67 -0
- package/dist/lib/aiFeatures.d.ts +31 -0
- package/dist/lib/aiSettingsNav.d.ts +14 -0
- package/dist/lib/backupBundle.d.ts +23 -0
- package/dist/lib/bookFolderTransfer.d.ts +15 -0
- package/dist/lib/download.d.ts +10 -0
- package/dist/lib/editorChrome.d.ts +14 -0
- package/dist/lib/emoji.d.ts +10 -0
- package/dist/lib/emojiData.d.ts +21 -0
- package/dist/lib/emojiPicker.d.ts +31 -0
- package/dist/lib/favorites.d.ts +11 -0
- package/dist/lib/homePage.d.ts +53 -0
- package/dist/lib/hud.d.ts +70 -0
- package/dist/lib/iconRecents.d.ts +3 -0
- package/dist/lib/iconValue.d.ts +19 -0
- package/dist/lib/lucideIcons.d.ts +21 -0
- package/dist/lib/openDocs.d.ts +5 -0
- package/dist/lib/pageActions.d.ts +17 -0
- package/dist/lib/pageAppearance.d.ts +20 -0
- package/dist/lib/pageCover.d.ts +21 -0
- package/dist/lib/pageCustomise.d.ts +6 -0
- package/dist/lib/pageDocActions.d.ts +20 -0
- package/dist/lib/pageFont.d.ts +25 -0
- package/dist/lib/pageFullWidth.d.ts +10 -0
- package/dist/lib/pageIcon.d.ts +25 -0
- package/dist/lib/pageLinks.d.ts +41 -0
- package/dist/lib/pageSaveStatus.d.ts +14 -0
- package/dist/lib/pageTheme.d.ts +15 -0
- package/dist/lib/pageThemePresets.d.ts +23 -0
- package/dist/lib/recents.d.ts +9 -0
- package/dist/lib/reviewPane.d.ts +23 -0
- package/dist/lib/selection.d.ts +2 -0
- package/dist/lib/shortcuts.d.ts +79 -0
- package/dist/lib/sidebarStyles.d.ts +10 -0
- package/dist/lib/suggestBridge.d.ts +33 -0
- package/dist/lib/textMerge.d.ts +19 -0
- package/dist/lib/themes.d.ts +137 -0
- package/dist/lib/treeMove.d.ts +24 -0
- package/dist/lib/useModifierHeld.d.ts +1 -0
- package/dist/lib/utils.d.ts +2 -0
- package/dist/lucideIcons-B6pmC-WQ.js +5003 -0
- package/dist/model-CBxw8JNb.js +734 -0
- package/dist/pageIcon-BWTy7hAh.js +32 -0
- package/dist/plugins/__tests__/host.test.d.ts +1 -0
- package/dist/plugins/__tests__/loader.test.d.ts +1 -0
- package/dist/plugins/__tests__/pagePlugin.test.d.ts +1 -0
- package/dist/plugins/api.d.ts +67 -0
- package/dist/plugins/commandRegistry.d.ts +15 -0
- package/dist/plugins/host.d.ts +32 -0
- package/dist/plugins/index.d.ts +5 -0
- package/dist/plugins/loader.d.ts +19 -0
- package/dist/plugins/pagePlugin.d.ts +21 -0
- package/dist/providers/AccountProvider.d.ts +67 -0
- package/dist/providers/ConfirmProvider.d.ts +30 -0
- package/dist/providers/ForwardingProvider.d.ts +23 -0
- package/dist/providers/HudProvider.d.ts +9 -0
- package/dist/providers/I18nProvider.d.ts +23 -0
- package/dist/providers/NavigationProvider.d.ts +89 -0
- package/dist/providers/PlatformLibraryProvider.d.ts +107 -0
- package/dist/providers/PreferencesProvider.d.ts +47 -0
- package/dist/providers/ThemeProvider.d.ts +26 -0
- package/dist/providers/WorkspaceProvider.d.ts +40 -0
- package/dist/providers/__tests__/PreferencesProvider.test.d.ts +1 -0
- package/dist/providers/__tests__/extractToken.test.d.ts +1 -0
- package/dist/providers/__tests__/windowModel.test.d.ts +1 -0
- package/dist/providers/index.d.ts +10 -0
- package/dist/providers/windowModel.d.ts +69 -0
- package/dist/screens/BlockPageDocument.d.ts +4 -0
- package/dist/screens/ConnectedPageDocument.d.ts +14 -0
- package/dist/screens/DataflowView.d.ts +2 -0
- package/dist/screens/HomeScreen.d.ts +7 -0
- package/dist/screens/index.d.ts +3 -0
- package/dist/screens/pageChrome.d.ts +46 -0
- package/dist/style.css +3 -0
- package/dist/toHtml-BoPr8Ce4.js +394 -0
- package/dist/toPdf-DGtKQSRA.js +133 -0
- package/package.json +94 -0
|
@@ -0,0 +1,987 @@
|
|
|
1
|
+
import { M as e, a as t, c as n, h as r, j as i, n as a, r as o, z as s } from "./model-CBxw8JNb.js";
|
|
2
|
+
//#region src/blockeditor/colors.ts
|
|
3
|
+
var c = [
|
|
4
|
+
{
|
|
5
|
+
id: "gray",
|
|
6
|
+
label: "Gray"
|
|
7
|
+
},
|
|
8
|
+
{
|
|
9
|
+
id: "brown",
|
|
10
|
+
label: "Brown"
|
|
11
|
+
},
|
|
12
|
+
{
|
|
13
|
+
id: "orange",
|
|
14
|
+
label: "Orange"
|
|
15
|
+
},
|
|
16
|
+
{
|
|
17
|
+
id: "yellow",
|
|
18
|
+
label: "Yellow"
|
|
19
|
+
},
|
|
20
|
+
{
|
|
21
|
+
id: "green",
|
|
22
|
+
label: "Green"
|
|
23
|
+
},
|
|
24
|
+
{
|
|
25
|
+
id: "blue",
|
|
26
|
+
label: "Blue"
|
|
27
|
+
},
|
|
28
|
+
{
|
|
29
|
+
id: "purple",
|
|
30
|
+
label: "Purple"
|
|
31
|
+
},
|
|
32
|
+
{
|
|
33
|
+
id: "pink",
|
|
34
|
+
label: "Pink"
|
|
35
|
+
},
|
|
36
|
+
{
|
|
37
|
+
id: "red",
|
|
38
|
+
label: "Red"
|
|
39
|
+
}
|
|
40
|
+
], l = new Set(c.map((e) => e.id)), u = (e) => !!e && l.has(e), d = {
|
|
41
|
+
gray: {
|
|
42
|
+
fg: "#6b7280",
|
|
43
|
+
hl: "#e5e7eb"
|
|
44
|
+
},
|
|
45
|
+
brown: {
|
|
46
|
+
fg: "#92400e",
|
|
47
|
+
hl: "#ece0d8"
|
|
48
|
+
},
|
|
49
|
+
orange: {
|
|
50
|
+
fg: "#c2410c",
|
|
51
|
+
hl: "#ffedd5"
|
|
52
|
+
},
|
|
53
|
+
yellow: {
|
|
54
|
+
fg: "#a16207",
|
|
55
|
+
hl: "#fef3c7"
|
|
56
|
+
},
|
|
57
|
+
green: {
|
|
58
|
+
fg: "#15803d",
|
|
59
|
+
hl: "#dcfce7"
|
|
60
|
+
},
|
|
61
|
+
blue: {
|
|
62
|
+
fg: "#1d4ed8",
|
|
63
|
+
hl: "#dbeafe"
|
|
64
|
+
},
|
|
65
|
+
purple: {
|
|
66
|
+
fg: "#7e22ce",
|
|
67
|
+
hl: "#f3e8ff"
|
|
68
|
+
},
|
|
69
|
+
pink: {
|
|
70
|
+
fg: "#be185d",
|
|
71
|
+
hl: "#fce7f3"
|
|
72
|
+
},
|
|
73
|
+
red: {
|
|
74
|
+
fg: "#b91c1c",
|
|
75
|
+
hl: "#fee2e2"
|
|
76
|
+
}
|
|
77
|
+
}, f = (e) => e.trim().toLowerCase().replace(/[^a-z0-9]+/g, "-").replace(/^-+|-+$/g, ""), p = new Set(/* @__PURE__ */ "break.case.catch.class.const.continue.debugger.default.delete.do.else.enum.export.extends.false.finally.for.function.if.import.in.instanceof.new.null.return.super.switch.this.throw.true.try.typeof.var.void.while.with.let.static.yield.await.async.implements.interface.package.private.protected.public.arguments.eval".split(".")), m = (e) => {
|
|
78
|
+
let t = e.normalize("NFKD").replace(/[\u0300-\u036f]/g, "").split(/[^A-Za-z0-9]+/).filter(Boolean);
|
|
79
|
+
if (t.length === 0) return "";
|
|
80
|
+
let n = t.map((e, t) => t === 0 ? e.toLowerCase() : e.charAt(0).toUpperCase() + e.slice(1).toLowerCase()).join(""), r = /^[0-9]/.test(n) ? `_${n}` : n;
|
|
81
|
+
return p.has(r) && (r = `${r}_`), r;
|
|
82
|
+
}, h = (e) => e.value?.trim() ? e.value.trim() : f(e.label);
|
|
83
|
+
function g(e) {
|
|
84
|
+
return e.split(",").map((e) => e.trim()).filter(Boolean).map((e) => {
|
|
85
|
+
let t = e.indexOf("=");
|
|
86
|
+
return t === -1 ? {
|
|
87
|
+
label: e,
|
|
88
|
+
value: e
|
|
89
|
+
} : {
|
|
90
|
+
label: e.slice(0, t).trim(),
|
|
91
|
+
value: e.slice(t + 1).trim()
|
|
92
|
+
};
|
|
93
|
+
});
|
|
94
|
+
}
|
|
95
|
+
function _(e) {
|
|
96
|
+
return Array.isArray(e.opts) ? e.opts.filter((e) => !!e && typeof e.label == "string").map((e) => ({
|
|
97
|
+
label: e.label,
|
|
98
|
+
value: e.value,
|
|
99
|
+
image: e.image,
|
|
100
|
+
icon: e.icon,
|
|
101
|
+
color: e.color
|
|
102
|
+
})) : typeof e.options == "string" ? g(e.options) : [];
|
|
103
|
+
}
|
|
104
|
+
var v = (e, t) => ({
|
|
105
|
+
label: e.label,
|
|
106
|
+
value: t,
|
|
107
|
+
...e.image ? { image: e.image } : {},
|
|
108
|
+
...e.icon ? { icon: e.icon } : {},
|
|
109
|
+
...e.color ? { color: e.color } : {}
|
|
110
|
+
});
|
|
111
|
+
function y(e) {
|
|
112
|
+
return _({
|
|
113
|
+
opts: t(e, "opts"),
|
|
114
|
+
options: t(e, "options")
|
|
115
|
+
}).map((e) => v(e, h(e)));
|
|
116
|
+
}
|
|
117
|
+
function b(e) {
|
|
118
|
+
return _(e).map((e) => v(e, h(e)));
|
|
119
|
+
}
|
|
120
|
+
var x = (e, t) => e.find((e) => e.value === t)?.label ?? t;
|
|
121
|
+
//#endregion
|
|
122
|
+
//#region src/blockeditor/kit/completion.ts
|
|
123
|
+
function S(e) {
|
|
124
|
+
return e == null ? !1 : typeof e == "string" ? e.trim().length > 0 : typeof e == "number" ? Number.isFinite(e) : typeof e == "boolean" ? e : Array.isArray(e) ? e.length > 0 : !0;
|
|
125
|
+
}
|
|
126
|
+
function C(e, r) {
|
|
127
|
+
for (let i of e) {
|
|
128
|
+
let e = n(i);
|
|
129
|
+
if (O.has(e)) {
|
|
130
|
+
r.total += 1, S(M(i)) && (r.done += 1);
|
|
131
|
+
continue;
|
|
132
|
+
}
|
|
133
|
+
if (e === "todo") {
|
|
134
|
+
r.total += 1, t(i, "checked") && (r.done += 1);
|
|
135
|
+
continue;
|
|
136
|
+
}
|
|
137
|
+
if (e === "tabs" || e === "accordion") continue;
|
|
138
|
+
let o = a(i);
|
|
139
|
+
o && C(o, r);
|
|
140
|
+
}
|
|
141
|
+
}
|
|
142
|
+
function w(e) {
|
|
143
|
+
let t = {
|
|
144
|
+
total: 0,
|
|
145
|
+
done: 0,
|
|
146
|
+
complete: !0,
|
|
147
|
+
ratio: 1
|
|
148
|
+
}, n = a(e);
|
|
149
|
+
return n && C(n, t), t.complete = t.done >= t.total, t.ratio = t.total === 0 ? 1 : t.done / t.total, t;
|
|
150
|
+
}
|
|
151
|
+
function ee(e) {
|
|
152
|
+
let t = {
|
|
153
|
+
total: 0,
|
|
154
|
+
done: 0,
|
|
155
|
+
complete: !0,
|
|
156
|
+
ratio: 1
|
|
157
|
+
}, n = a(e);
|
|
158
|
+
if (n) for (let e of n) {
|
|
159
|
+
let n = w(e);
|
|
160
|
+
t.total += n.total, t.done += n.done;
|
|
161
|
+
}
|
|
162
|
+
return t.complete = t.done >= t.total, t.ratio = t.total === 0 ? 1 : t.done / t.total, t;
|
|
163
|
+
}
|
|
164
|
+
function te(e) {
|
|
165
|
+
let t = ee(e), n = a(e) ?? [];
|
|
166
|
+
return {
|
|
167
|
+
...t,
|
|
168
|
+
sections: [...n].map(w)
|
|
169
|
+
};
|
|
170
|
+
}
|
|
171
|
+
function T(e) {
|
|
172
|
+
let r = {}, o = (e) => {
|
|
173
|
+
for (let i of e) {
|
|
174
|
+
let e = n(i);
|
|
175
|
+
if (e === "tabs" || e === "accordion") {
|
|
176
|
+
let e = D(i) || m(t(i, "name") ?? "");
|
|
177
|
+
e && !(e in r) && (r[e] = te(i));
|
|
178
|
+
}
|
|
179
|
+
let s = a(i);
|
|
180
|
+
s && o(s);
|
|
181
|
+
}
|
|
182
|
+
};
|
|
183
|
+
return o(i(e)), r;
|
|
184
|
+
}
|
|
185
|
+
//#endregion
|
|
186
|
+
//#region src/blockeditor/kit/scope.ts
|
|
187
|
+
var E = /^[A-Za-z_$][A-Za-z0-9_$]*$/;
|
|
188
|
+
function D(e) {
|
|
189
|
+
let n = (t(e, "name") ?? "").trim();
|
|
190
|
+
if (n) return E.test(n) ? n : "";
|
|
191
|
+
let r = m(t(e, "label") ?? "");
|
|
192
|
+
return r && E.test(r) ? r : "";
|
|
193
|
+
}
|
|
194
|
+
var O = new Set([
|
|
195
|
+
"slider",
|
|
196
|
+
"number",
|
|
197
|
+
"textfield",
|
|
198
|
+
"radio",
|
|
199
|
+
"checklist",
|
|
200
|
+
"dropdown",
|
|
201
|
+
"location",
|
|
202
|
+
"toggle",
|
|
203
|
+
"choicecards",
|
|
204
|
+
"longtext",
|
|
205
|
+
"richtext",
|
|
206
|
+
"searchselect",
|
|
207
|
+
"tagfield"
|
|
208
|
+
]);
|
|
209
|
+
function k(e) {
|
|
210
|
+
return m(t(e, "name") ?? "");
|
|
211
|
+
}
|
|
212
|
+
function A(e, t, r) {
|
|
213
|
+
for (let i of e) {
|
|
214
|
+
let e = n(i);
|
|
215
|
+
O.has(e) && r(i, t);
|
|
216
|
+
let o = a(i);
|
|
217
|
+
o && A(o, e === "group" && k(i) || t, r);
|
|
218
|
+
}
|
|
219
|
+
}
|
|
220
|
+
function j(e) {
|
|
221
|
+
let n = t(e, "runs");
|
|
222
|
+
return Array.isArray(n) ? n.map((e) => e.t).join("") : "";
|
|
223
|
+
}
|
|
224
|
+
function M(e) {
|
|
225
|
+
switch (n(e)) {
|
|
226
|
+
case "slider":
|
|
227
|
+
case "number": return Number(t(e, "value") ?? 0);
|
|
228
|
+
case "textfield": return String(t(e, "value") ?? "");
|
|
229
|
+
case "radio":
|
|
230
|
+
case "dropdown": return t(e, "value") ?? null;
|
|
231
|
+
case "checklist": {
|
|
232
|
+
let n = t(e, "selected");
|
|
233
|
+
return Array.isArray(n) ? n : [];
|
|
234
|
+
}
|
|
235
|
+
case "choicecards":
|
|
236
|
+
if (t(e, "multi")) {
|
|
237
|
+
let n = t(e, "selected");
|
|
238
|
+
return Array.isArray(n) ? n : [];
|
|
239
|
+
}
|
|
240
|
+
return t(e, "value") ?? null;
|
|
241
|
+
case "searchselect":
|
|
242
|
+
case "tagfield":
|
|
243
|
+
if (n(e) === "tagfield" || t(e, "multi")) {
|
|
244
|
+
let n = t(e, "selected");
|
|
245
|
+
return Array.isArray(n) ? n : [];
|
|
246
|
+
}
|
|
247
|
+
return t(e, "value") ?? null;
|
|
248
|
+
case "longtext": return String(t(e, "value") ?? "");
|
|
249
|
+
case "richtext": return j(e);
|
|
250
|
+
case "toggle": return !!(t(e, "value") ?? !1);
|
|
251
|
+
case "location": {
|
|
252
|
+
let n = t(e, "lat"), r = t(e, "lng");
|
|
253
|
+
return {
|
|
254
|
+
lat: n ?? null,
|
|
255
|
+
lng: r ?? null,
|
|
256
|
+
label: t(e, "label") ?? ""
|
|
257
|
+
};
|
|
258
|
+
}
|
|
259
|
+
default: return;
|
|
260
|
+
}
|
|
261
|
+
}
|
|
262
|
+
function ne(e) {
|
|
263
|
+
let t = { ...T(e) };
|
|
264
|
+
return A(i(e), "", (e, n) => {
|
|
265
|
+
let r = D(e);
|
|
266
|
+
if (r) if (n) {
|
|
267
|
+
let i = t[n] ?? (t[n] = {});
|
|
268
|
+
i[r] = { value: M(e) };
|
|
269
|
+
} else t[r] = M(e);
|
|
270
|
+
}), t;
|
|
271
|
+
}
|
|
272
|
+
function N(e, t) {
|
|
273
|
+
for (let { block: r } of s(i(e))) if (O.has(n(r)) && D(r) === t) return r;
|
|
274
|
+
return null;
|
|
275
|
+
}
|
|
276
|
+
function P(r, i) {
|
|
277
|
+
let a = n(r);
|
|
278
|
+
switch (a) {
|
|
279
|
+
case "checklist":
|
|
280
|
+
e(r, "selected", Array.isArray(i) ? i : []);
|
|
281
|
+
break;
|
|
282
|
+
case "choicecards":
|
|
283
|
+
case "searchselect":
|
|
284
|
+
case "tagfield":
|
|
285
|
+
a === "tagfield" || t(r, "multi") ? e(r, "selected", Array.isArray(i) ? i : []) : e(r, "value", i);
|
|
286
|
+
break;
|
|
287
|
+
case "richtext":
|
|
288
|
+
e(r, "runs", [{ t: String(i ?? "") }]);
|
|
289
|
+
break;
|
|
290
|
+
case "location": break;
|
|
291
|
+
default:
|
|
292
|
+
e(r, "value", i);
|
|
293
|
+
break;
|
|
294
|
+
}
|
|
295
|
+
}
|
|
296
|
+
function F(e) {
|
|
297
|
+
let t = /* @__PURE__ */ new Map(), r = (e) => {
|
|
298
|
+
for (let i of e) {
|
|
299
|
+
let e = n(i);
|
|
300
|
+
if (O.has(e)) {
|
|
301
|
+
let e = D(i);
|
|
302
|
+
e && !t.has(e) && t.set(e, i);
|
|
303
|
+
}
|
|
304
|
+
let o = a(i);
|
|
305
|
+
o && e !== "group" && r(o);
|
|
306
|
+
}
|
|
307
|
+
}, i = a(e);
|
|
308
|
+
return i && r(i), t;
|
|
309
|
+
}
|
|
310
|
+
function I(r, i, a) {
|
|
311
|
+
let o = N(r, i);
|
|
312
|
+
if (!o) return;
|
|
313
|
+
let s = n(o);
|
|
314
|
+
s !== "slider" && s !== "number" && s !== "toggle" || r.transact(() => {
|
|
315
|
+
if (s === "toggle") {
|
|
316
|
+
e(o, "value", !t(o, "value"));
|
|
317
|
+
return;
|
|
318
|
+
}
|
|
319
|
+
let n = a(Number(t(o, "value") ?? 0)), r = t(o, "min"), i = t(o, "max");
|
|
320
|
+
typeof r == "number" && (n = Math.max(r, n)), typeof i == "number" && (n = Math.min(i, n)), e(o, "value", n);
|
|
321
|
+
}, "local");
|
|
322
|
+
}
|
|
323
|
+
function L(e, t) {
|
|
324
|
+
if (!e.trim()) return { value: void 0 };
|
|
325
|
+
try {
|
|
326
|
+
return { value: Function(...Object.keys(t), `"use strict"; return (${e});`)(...Object.values(t)) };
|
|
327
|
+
} catch (e) {
|
|
328
|
+
return { error: e instanceof Error ? e.message : String(e) };
|
|
329
|
+
}
|
|
330
|
+
}
|
|
331
|
+
function R(e, t) {
|
|
332
|
+
if (!e.trim()) return { value: void 0 };
|
|
333
|
+
let n = Object.keys(t), r = Object.values(t);
|
|
334
|
+
try {
|
|
335
|
+
return { value: Function(...n, `"use strict"; return (${e});`)(...r) };
|
|
336
|
+
} catch (e) {
|
|
337
|
+
if (!(e instanceof SyntaxError)) return { error: e instanceof Error ? e.message : String(e) };
|
|
338
|
+
}
|
|
339
|
+
try {
|
|
340
|
+
return { value: Function(...n, `"use strict"; ${e}`)(...r) };
|
|
341
|
+
} catch (e) {
|
|
342
|
+
return { error: e instanceof Error ? e.message : String(e) };
|
|
343
|
+
}
|
|
344
|
+
}
|
|
345
|
+
function z(e) {
|
|
346
|
+
let r = ne(e), a = /* @__PURE__ */ new Map();
|
|
347
|
+
for (let { block: o } of s(i(e))) {
|
|
348
|
+
let e = n(o), i = e === "code" && !!t(o, "live");
|
|
349
|
+
if (!i && e !== "formula") continue;
|
|
350
|
+
let s = i ? B(o) ?? "" : t(o, "source") ?? "", c = i ? R(s, r) : L(s, r);
|
|
351
|
+
a.set(String(o.get("id")), c);
|
|
352
|
+
let l = t(o, "name");
|
|
353
|
+
l && E.test(l) && !c.error && (r[l] = c.value);
|
|
354
|
+
}
|
|
355
|
+
return {
|
|
356
|
+
scope: r,
|
|
357
|
+
results: a
|
|
358
|
+
};
|
|
359
|
+
}
|
|
360
|
+
function B(e) {
|
|
361
|
+
let t = e.get("text");
|
|
362
|
+
return t && typeof t.toString == "function" ? String(t) : void 0;
|
|
363
|
+
}
|
|
364
|
+
function V(e) {
|
|
365
|
+
return e == null ? "—" : typeof e == "number" && !Number.isInteger(e) ? String(Math.round(e * 1e3) / 1e3) : Array.isArray(e) ? e.map(V).join(", ") : typeof e == "object" ? JSON.stringify(e) : String(e);
|
|
366
|
+
}
|
|
367
|
+
function H(e, t, n, r) {
|
|
368
|
+
return t || e == null ? "off" : typeof e == "boolean" ? e ? "ok" : "bad" : typeof e == "string" ? e === "ok" || e === "warn" || e === "bad" ? e : "off" : typeof e == "number" ? e >= n ? "ok" : e >= r ? "warn" : "bad" : "off";
|
|
369
|
+
}
|
|
370
|
+
function U(e) {
|
|
371
|
+
let { scope: r, results: a } = z(e), c = /* @__PURE__ */ new Map();
|
|
372
|
+
for (let { block: l } of s(i(e))) {
|
|
373
|
+
let e = o(l), i = n(l);
|
|
374
|
+
if (O.has(i)) c.set(e, { value: M(l) });
|
|
375
|
+
else if (i === "formula" || i === "code" && t(l, "live")) {
|
|
376
|
+
let t = a.get(e);
|
|
377
|
+
c.set(e, { value: t?.error ? void 0 : t?.value });
|
|
378
|
+
} else if (i === "kitchart" || i === "progressbar") c.set(e, { value: L(t(l, "source") ?? "", r).value });
|
|
379
|
+
else if (i === "statuslight") {
|
|
380
|
+
let { value: n, error: i } = L(t(l, "source") ?? "", r), a = Number(t(l, "okAt") ?? 1), o = Number(t(l, "warnAt") ?? 0);
|
|
381
|
+
c.set(e, {
|
|
382
|
+
value: n,
|
|
383
|
+
status: H(n, i, a, o)
|
|
384
|
+
});
|
|
385
|
+
}
|
|
386
|
+
}
|
|
387
|
+
return c;
|
|
388
|
+
}
|
|
389
|
+
//#endregion
|
|
390
|
+
//#region src/blockeditor/exportBlocks.ts
|
|
391
|
+
var W = (e) => e.replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">").replace(/"/g, """);
|
|
392
|
+
function G(e) {
|
|
393
|
+
let t = W(e.t).replace(/\n/g, "<br>"), n = e.a ?? {};
|
|
394
|
+
return n.c && (t = `<code>${t}</code>`), n.b && (t = `<strong>${t}</strong>`), n.i && (t = `<em>${t}</em>`), n.u && (t = `<u>${t}</u>`), n.s && (t = `<s>${t}</s>`), n.hl && (t = `<mark${d[n.hl] ? ` style="background:${d[n.hl].hl}"` : ""}>${t}</mark>`), n.tc && d[n.tc] && (t = `<span style="color:${d[n.tc].fg}">${t}</span>`), n.m ? t = `<a class="ob-mention" data-page-id="${W(n.m)}">${t}</a>` : n.a && (t = `<a href="${W(n.a)}">${t}</a>`), t;
|
|
395
|
+
}
|
|
396
|
+
var K = (e) => (e ?? []).map(G).join("");
|
|
397
|
+
function q(e) {
|
|
398
|
+
let t = e.props ?? {};
|
|
399
|
+
if (e.type === "richtext") return Array.isArray(t.runs) ? K(t.runs) : "";
|
|
400
|
+
if (e.type === "longtext") return K([{ t: String(t.value ?? "") }]);
|
|
401
|
+
let n = b(t), r = (e) => n.find((t) => t.value === e)?.label ?? e, i = e.type === "tagfield" || t.multi ? Array.isArray(t.selected) ? t.selected : [] : t.value ?? null;
|
|
402
|
+
return K([{ t: Array.isArray(i) ? i.map(r).join(", ") : i ? r(String(i)) : "—" }]);
|
|
403
|
+
}
|
|
404
|
+
function J(e) {
|
|
405
|
+
let t = e.t, n = e.a ?? {};
|
|
406
|
+
return n.c && (t = `\`${t}\``), n.b && (t = `**${t}**`), n.i && (t = `*${t}*`), n.s && (t = `~~${t}~~`), n.a && (t = `[${t}](${n.a})`), t;
|
|
407
|
+
}
|
|
408
|
+
var Y = (e) => (e ?? []).map(J).join("");
|
|
409
|
+
function X(e) {
|
|
410
|
+
let t = e.props ?? {};
|
|
411
|
+
if (e.type === "richtext") return Array.isArray(t.runs) ? Y(t.runs) : "";
|
|
412
|
+
if (e.type === "longtext") return String(t.value ?? "");
|
|
413
|
+
let n = b(t), r = (e) => n.find((t) => t.value === e)?.label ?? e, i = e.type === "tagfield" || t.multi ? Array.isArray(t.selected) ? t.selected : [] : t.value ?? null;
|
|
414
|
+
return Array.isArray(i) ? i.map(r).join(", ") : i ? r(String(i)) : "—";
|
|
415
|
+
}
|
|
416
|
+
function Z(e) {
|
|
417
|
+
let t = [], n = 0;
|
|
418
|
+
for (; n < e.length;) {
|
|
419
|
+
let r = e[n];
|
|
420
|
+
switch (r.type) {
|
|
421
|
+
case "heading": {
|
|
422
|
+
let e = Math.min(6, Math.max(1, Number(r.props?.level ?? 2)));
|
|
423
|
+
t.push(`<h${e}>${K(r.text)}</h${e}>`), n += 1;
|
|
424
|
+
break;
|
|
425
|
+
}
|
|
426
|
+
case "list": {
|
|
427
|
+
let i = r.props?.kind ?? "bullet", a = i === "number" ? "ol" : "ul", o = [];
|
|
428
|
+
for (; n < e.length && e[n].type === "list" && (e[n].props?.kind ?? "bullet") === i;) o.push(`<li>${K(e[n].text)}</li>`), n += 1;
|
|
429
|
+
t.push(`<${a}>${o.join("")}</${a}>`);
|
|
430
|
+
break;
|
|
431
|
+
}
|
|
432
|
+
case "todo": {
|
|
433
|
+
let e = !!r.props?.checked;
|
|
434
|
+
t.push(`<div class="obe-x-todo"><input type="checkbox" disabled${e ? " checked" : ""}> ${K(r.text)}</div>`), n += 1;
|
|
435
|
+
break;
|
|
436
|
+
}
|
|
437
|
+
case "quote":
|
|
438
|
+
t.push(`<blockquote>${K(r.text)}</blockquote>`), n += 1;
|
|
439
|
+
break;
|
|
440
|
+
case "callout":
|
|
441
|
+
t.push(`<aside class="obe-x-callout obe-x-${r.props?.variant ?? "info"}">${K(r.text)}</aside>`), n += 1;
|
|
442
|
+
break;
|
|
443
|
+
case "code":
|
|
444
|
+
t.push(`<pre><code>${W((r.text ?? []).map((e) => e.t).join(""))}</code></pre>`), n += 1;
|
|
445
|
+
break;
|
|
446
|
+
case "notes":
|
|
447
|
+
n += 1;
|
|
448
|
+
break;
|
|
449
|
+
case "divider":
|
|
450
|
+
t.push("<hr>"), n += 1;
|
|
451
|
+
break;
|
|
452
|
+
case "columns": {
|
|
453
|
+
let e = (r.children ?? []).map((e) => `<div style="flex:1;min-width:0">${Z(e.children ?? [])}</div>`).join("");
|
|
454
|
+
t.push(`<div style="display:flex;gap:1.25rem" class="obe-x-columns">${e}</div>`), n += 1;
|
|
455
|
+
break;
|
|
456
|
+
}
|
|
457
|
+
case "table": {
|
|
458
|
+
let e = r.children ?? [], i = !!r.props?.header, a = e.map((e, t) => {
|
|
459
|
+
let n = i && t === 0 ? "th" : "td";
|
|
460
|
+
return `<tr>${(e.children ?? []).map((e) => `<${n}>${K(e.text)}</${n}>`).join("")}</tr>`;
|
|
461
|
+
}).join("");
|
|
462
|
+
t.push(`<table class="obe-x-table"><tbody>${a}</tbody></table>`), n += 1;
|
|
463
|
+
break;
|
|
464
|
+
}
|
|
465
|
+
case "dbview":
|
|
466
|
+
t.push(`<p><a class="ob-mention" data-page-id="${W(String(r.props?.pageId ?? ""))}">🗃 ${W(String(r.props?.name ?? "Database"))}</a></p>`), n += 1;
|
|
467
|
+
break;
|
|
468
|
+
case "group": {
|
|
469
|
+
let e = String(r.props?.name ?? "").trim(), i = e ? `<p class="obe-x-group-name"><strong>${W(e)}</strong></p>` : "";
|
|
470
|
+
t.push(`<section class="obe-x-group">${i}${Z(r.children ?? [])}</section>`), n += 1;
|
|
471
|
+
break;
|
|
472
|
+
}
|
|
473
|
+
case "tabs":
|
|
474
|
+
case "accordion": {
|
|
475
|
+
let e = (r.children ?? []).map((e) => {
|
|
476
|
+
let t = String(e.props?.label ?? "").trim();
|
|
477
|
+
return `<section class="obe-x-section">${t ? `<h3>${W(t)}</h3>` : ""}${Z(e.children ?? [])}</section>`;
|
|
478
|
+
}).join("");
|
|
479
|
+
t.push(`<section class="obe-x-${r.type}">${e}</section>`), n += 1;
|
|
480
|
+
break;
|
|
481
|
+
}
|
|
482
|
+
case "choicecards":
|
|
483
|
+
case "searchselect":
|
|
484
|
+
case "tagfield":
|
|
485
|
+
case "longtext":
|
|
486
|
+
case "richtext": {
|
|
487
|
+
let e = String(r.props?.label ?? r.props?.name ?? "").trim(), i = e ? `<strong>${W(e)}:</strong> ` : "", a = q(r);
|
|
488
|
+
t.push(`<p class="obe-x-kitvalue">${i}${a}</p>`), n += 1;
|
|
489
|
+
break;
|
|
490
|
+
}
|
|
491
|
+
default: t.push(`<p>${K(r.text) || " "}</p>`), n += 1;
|
|
492
|
+
}
|
|
493
|
+
}
|
|
494
|
+
return t.join("\n");
|
|
495
|
+
}
|
|
496
|
+
function Q(e) {
|
|
497
|
+
let t = [], n = 0;
|
|
498
|
+
for (let r of e) switch ((r.type !== "list" || r.props?.kind !== "number") && (n = 0), r.type) {
|
|
499
|
+
case "heading":
|
|
500
|
+
t.push(`${"#".repeat(Math.min(6, Math.max(1, Number(r.props?.level ?? 2))))} ${Y(r.text)}`);
|
|
501
|
+
break;
|
|
502
|
+
case "list":
|
|
503
|
+
r.props?.kind === "number" ? (n += 1, t.push(`${n}. ${Y(r.text)}`)) : t.push(`- ${Y(r.text)}`);
|
|
504
|
+
break;
|
|
505
|
+
case "todo":
|
|
506
|
+
t.push(`- [${r.props?.checked ? "x" : " "}] ${Y(r.text)}`);
|
|
507
|
+
break;
|
|
508
|
+
case "quote":
|
|
509
|
+
t.push(`> ${Y(r.text)}`);
|
|
510
|
+
break;
|
|
511
|
+
case "callout":
|
|
512
|
+
t.push(`> **${(r.props?.variant ?? "note").toUpperCase()}:** ${Y(r.text)}`);
|
|
513
|
+
break;
|
|
514
|
+
case "code":
|
|
515
|
+
t.push(`\`\`\`${r.props?.language ?? ""}\n${(r.text ?? []).map((e) => e.t).join("")}\n\`\`\``);
|
|
516
|
+
break;
|
|
517
|
+
case "notes": break;
|
|
518
|
+
case "divider":
|
|
519
|
+
t.push("---");
|
|
520
|
+
break;
|
|
521
|
+
case "columns":
|
|
522
|
+
for (let e of r.children ?? []) t.push(Q(e.children ?? []));
|
|
523
|
+
break;
|
|
524
|
+
case "table": {
|
|
525
|
+
let e = (r.children ?? []).map((e) => (e.children ?? []).map((e) => Y(e.text).replace(/\|/g, "\\|")));
|
|
526
|
+
if (e.length > 0) {
|
|
527
|
+
let n = Math.max(...e.map((e) => e.length)), r = (e) => [...e, ...Array.from({ length: n - e.length }, () => "")], i = [
|
|
528
|
+
`| ${r(e[0]).join(" | ")} |`,
|
|
529
|
+
`| ${Array.from({ length: n }, () => "---").join(" | ")} |`,
|
|
530
|
+
...e.slice(1).map((e) => `| ${r(e).join(" | ")} |`)
|
|
531
|
+
];
|
|
532
|
+
t.push(i.join("\n"));
|
|
533
|
+
}
|
|
534
|
+
break;
|
|
535
|
+
}
|
|
536
|
+
case "dbview":
|
|
537
|
+
t.push(`**🗃 ${String(r.props?.name ?? "Database")}**`);
|
|
538
|
+
break;
|
|
539
|
+
case "group": {
|
|
540
|
+
let e = String(r.props?.name ?? "").trim();
|
|
541
|
+
e && t.push(`**${e}**`), t.push(Q(r.children ?? []));
|
|
542
|
+
break;
|
|
543
|
+
}
|
|
544
|
+
case "tabs":
|
|
545
|
+
case "accordion":
|
|
546
|
+
for (let e of r.children ?? []) {
|
|
547
|
+
let n = String(e.props?.label ?? "").trim();
|
|
548
|
+
n && t.push(`### ${n}`), t.push(Q(e.children ?? []));
|
|
549
|
+
}
|
|
550
|
+
break;
|
|
551
|
+
case "choicecards":
|
|
552
|
+
case "searchselect":
|
|
553
|
+
case "tagfield":
|
|
554
|
+
case "longtext":
|
|
555
|
+
case "richtext": {
|
|
556
|
+
let e = String(r.props?.label ?? r.props?.name ?? "").trim(), n = X(r);
|
|
557
|
+
t.push(e ? `**${e}:** ${n}` : n);
|
|
558
|
+
break;
|
|
559
|
+
}
|
|
560
|
+
default: t.push(Y(r.text));
|
|
561
|
+
}
|
|
562
|
+
return t.join("\n\n");
|
|
563
|
+
}
|
|
564
|
+
var re = (e) => e.replace(/[.*+?^${}()|[\]\\]/g, "\\$&"), $ = {
|
|
565
|
+
slider: (e) => Number(e.value ?? 50),
|
|
566
|
+
number: (e) => Number(e.value ?? 0),
|
|
567
|
+
textfield: (e) => String(e.value ?? ""),
|
|
568
|
+
radio: (e) => e.value ?? null,
|
|
569
|
+
dropdown: (e) => e.value ?? null,
|
|
570
|
+
checklist: (e) => Array.isArray(e.selected) ? e.selected : [],
|
|
571
|
+
toggle: (e) => !!(e.value ?? !1),
|
|
572
|
+
location: (e) => ({
|
|
573
|
+
lat: e.lat ?? null,
|
|
574
|
+
lng: e.lng ?? null,
|
|
575
|
+
label: e.labeltext ?? ""
|
|
576
|
+
}),
|
|
577
|
+
choicecards: (e) => e.multi ? Array.isArray(e.selected) ? e.selected : [] : e.value ?? null,
|
|
578
|
+
searchselect: (e) => e.multi ? Array.isArray(e.selected) ? e.selected : [] : e.value ?? null,
|
|
579
|
+
tagfield: (e) => Array.isArray(e.selected) ? e.selected : [],
|
|
580
|
+
longtext: (e) => String(e.value ?? ""),
|
|
581
|
+
richtext: (e) => Array.isArray(e.runs) ? e.runs.map((e) => e?.t ?? "").join("") : ""
|
|
582
|
+
};
|
|
583
|
+
function ie(e, t) {
|
|
584
|
+
let n = {
|
|
585
|
+
blocks: [],
|
|
586
|
+
values: [],
|
|
587
|
+
names: []
|
|
588
|
+
}, r = (e) => {
|
|
589
|
+
t?.has(e) && n.values.push([e, t.get(e).value]);
|
|
590
|
+
}, i = [], a = /* @__PURE__ */ new Map(), o = (e, t) => {
|
|
591
|
+
for (let n of e) {
|
|
592
|
+
if ($[n.type] && n.props?.name) {
|
|
593
|
+
let e = String(n.props.name);
|
|
594
|
+
i.push({
|
|
595
|
+
id: n.id,
|
|
596
|
+
name: t ? `${t}.${e}.value` : e
|
|
597
|
+
}), a.set(n.id, n.props ?? {});
|
|
598
|
+
}
|
|
599
|
+
n.type === "code" && n.props?.live && n.props?.name && i.push({
|
|
600
|
+
id: n.id,
|
|
601
|
+
name: String(n.props.name)
|
|
602
|
+
}), n.type === "formula" && n.props?.name && i.push({
|
|
603
|
+
id: n.id,
|
|
604
|
+
name: String(n.props.name)
|
|
605
|
+
}), n.children && o(n.children, n.type === "group" && m(String(n.props?.name ?? "")) || t);
|
|
606
|
+
}
|
|
607
|
+
};
|
|
608
|
+
o(e, ""), i.sort((e, t) => t.name.length - e.name.length);
|
|
609
|
+
let s = (e) => {
|
|
610
|
+
let t = e;
|
|
611
|
+
for (let { id: e, name: n } of i) t = t.replace(RegExp(`\\b${re(n)}\\b`, "g"), `__C__{${e}}__`);
|
|
612
|
+
return t;
|
|
613
|
+
}, c = (e) => {
|
|
614
|
+
let t = $[e.type];
|
|
615
|
+
t && (n.values.push([e.id, t(e.props ?? {})]), e.props?.name && n.names.push([String(e.props.name), e.id]));
|
|
616
|
+
}, l = (e, o = n.blocks) => {
|
|
617
|
+
let u = 0;
|
|
618
|
+
for (; u < e.length;) {
|
|
619
|
+
let d = e[u];
|
|
620
|
+
switch (d.type) {
|
|
621
|
+
case "heading":
|
|
622
|
+
o.push({
|
|
623
|
+
id: d.id,
|
|
624
|
+
type: "header",
|
|
625
|
+
data: {
|
|
626
|
+
text: K(d.text),
|
|
627
|
+
level: Number(d.props?.level ?? 2)
|
|
628
|
+
}
|
|
629
|
+
}), u += 1;
|
|
630
|
+
break;
|
|
631
|
+
case "list": {
|
|
632
|
+
let t = d.props?.kind ?? "bullet", n = [];
|
|
633
|
+
for (; u < e.length && e[u].type === "list" && (e[u].props?.kind ?? "bullet") === t;) n.push(K(e[u].text)), u += 1;
|
|
634
|
+
o.push({
|
|
635
|
+
type: "list",
|
|
636
|
+
data: {
|
|
637
|
+
style: t === "number" ? "ordered" : "unordered",
|
|
638
|
+
items: n
|
|
639
|
+
}
|
|
640
|
+
});
|
|
641
|
+
break;
|
|
642
|
+
}
|
|
643
|
+
case "todo": {
|
|
644
|
+
let t = [];
|
|
645
|
+
for (; u < e.length && e[u].type === "todo";) t.push({
|
|
646
|
+
text: K(e[u].text),
|
|
647
|
+
checked: !!e[u].props?.checked
|
|
648
|
+
}), u += 1;
|
|
649
|
+
o.push({
|
|
650
|
+
type: "checklist",
|
|
651
|
+
data: { items: t }
|
|
652
|
+
});
|
|
653
|
+
break;
|
|
654
|
+
}
|
|
655
|
+
case "quote":
|
|
656
|
+
o.push({
|
|
657
|
+
id: d.id,
|
|
658
|
+
type: "quote",
|
|
659
|
+
data: { text: K(d.text) }
|
|
660
|
+
}), u += 1;
|
|
661
|
+
break;
|
|
662
|
+
case "callout":
|
|
663
|
+
o.push({
|
|
664
|
+
id: d.id,
|
|
665
|
+
type: "callout",
|
|
666
|
+
data: {
|
|
667
|
+
variant: d.props?.variant ?? "info",
|
|
668
|
+
text: K(d.text)
|
|
669
|
+
}
|
|
670
|
+
}), u += 1;
|
|
671
|
+
break;
|
|
672
|
+
case "code": {
|
|
673
|
+
let e = (d.text ?? []).map((e) => e.t).join("");
|
|
674
|
+
d.props?.live ? (o.push({
|
|
675
|
+
id: d.id,
|
|
676
|
+
type: "expr",
|
|
677
|
+
data: {
|
|
678
|
+
name: String(d.props?.name ?? ""),
|
|
679
|
+
source: s(e)
|
|
680
|
+
}
|
|
681
|
+
}), r(d.id), d.props?.name && n.names.push([String(d.props.name), d.id])) : o.push({
|
|
682
|
+
id: d.id,
|
|
683
|
+
type: "code",
|
|
684
|
+
data: {
|
|
685
|
+
code: e,
|
|
686
|
+
language: d.props?.language
|
|
687
|
+
}
|
|
688
|
+
}), u += 1;
|
|
689
|
+
break;
|
|
690
|
+
}
|
|
691
|
+
case "notes":
|
|
692
|
+
u += 1;
|
|
693
|
+
break;
|
|
694
|
+
case "divider":
|
|
695
|
+
o.push({
|
|
696
|
+
id: d.id,
|
|
697
|
+
type: "divider",
|
|
698
|
+
data: { style: "line" }
|
|
699
|
+
}), u += 1;
|
|
700
|
+
break;
|
|
701
|
+
case "table": {
|
|
702
|
+
let e = (d.children ?? []).map((e) => (e.children ?? []).map((e) => K(e.text)));
|
|
703
|
+
o.push({
|
|
704
|
+
id: d.id,
|
|
705
|
+
type: "table",
|
|
706
|
+
data: {
|
|
707
|
+
withHeadings: !!d.props?.header,
|
|
708
|
+
content: e
|
|
709
|
+
}
|
|
710
|
+
}), u += 1;
|
|
711
|
+
break;
|
|
712
|
+
}
|
|
713
|
+
case "columns": {
|
|
714
|
+
let e = (d.children ?? []).map((e) => {
|
|
715
|
+
let t = [];
|
|
716
|
+
return l(e.children ?? [], t), t;
|
|
717
|
+
});
|
|
718
|
+
o.push({
|
|
719
|
+
id: d.id,
|
|
720
|
+
type: "columns",
|
|
721
|
+
data: { columns: e }
|
|
722
|
+
}), u += 1;
|
|
723
|
+
break;
|
|
724
|
+
}
|
|
725
|
+
case "tabs":
|
|
726
|
+
case "accordion":
|
|
727
|
+
for (let e of d.children ?? []) {
|
|
728
|
+
let t = String(e.props?.label ?? "").trim();
|
|
729
|
+
t && o.push({
|
|
730
|
+
type: "header",
|
|
731
|
+
data: {
|
|
732
|
+
text: K([{ t }]),
|
|
733
|
+
level: 3
|
|
734
|
+
}
|
|
735
|
+
}), l(e.children ?? [], o);
|
|
736
|
+
}
|
|
737
|
+
u += 1;
|
|
738
|
+
break;
|
|
739
|
+
case "group":
|
|
740
|
+
l(d.children ?? [], o), u += 1;
|
|
741
|
+
break;
|
|
742
|
+
case "slider": {
|
|
743
|
+
let e = String(d.props?.name ?? "x"), t = Number(d.props?.value ?? 50);
|
|
744
|
+
o.push({
|
|
745
|
+
id: d.id,
|
|
746
|
+
type: "slider",
|
|
747
|
+
data: {
|
|
748
|
+
name: e,
|
|
749
|
+
min: Number(d.props?.min ?? 0),
|
|
750
|
+
max: Number(d.props?.max ?? 100),
|
|
751
|
+
step: 1,
|
|
752
|
+
initial: t
|
|
753
|
+
}
|
|
754
|
+
}), c(d), u += 1;
|
|
755
|
+
break;
|
|
756
|
+
}
|
|
757
|
+
case "number": {
|
|
758
|
+
let e = String(d.props?.name ?? "n"), t = Number(d.props?.value ?? 0), n = Number(d.props?.min ?? Math.min(0, t)), r = Number(d.props?.max ?? Math.max(100, t * 2 || 10));
|
|
759
|
+
o.push({
|
|
760
|
+
id: d.id,
|
|
761
|
+
type: "slider",
|
|
762
|
+
data: {
|
|
763
|
+
name: e,
|
|
764
|
+
min: n,
|
|
765
|
+
max: r,
|
|
766
|
+
step: Number(d.props?.step ?? 1),
|
|
767
|
+
initial: t
|
|
768
|
+
}
|
|
769
|
+
}), c(d), u += 1;
|
|
770
|
+
break;
|
|
771
|
+
}
|
|
772
|
+
case "formula": {
|
|
773
|
+
let e = String(d.props?.name ?? "");
|
|
774
|
+
o.push({
|
|
775
|
+
id: d.id,
|
|
776
|
+
type: "expr",
|
|
777
|
+
data: {
|
|
778
|
+
name: e,
|
|
779
|
+
source: s(String(d.props?.source ?? ""))
|
|
780
|
+
}
|
|
781
|
+
}), r(d.id), e && n.names.push([e, d.id]), u += 1;
|
|
782
|
+
break;
|
|
783
|
+
}
|
|
784
|
+
case "statuslight":
|
|
785
|
+
o.push({
|
|
786
|
+
id: d.id,
|
|
787
|
+
type: "expr",
|
|
788
|
+
data: {
|
|
789
|
+
name: String(d.props?.label ?? "Status"),
|
|
790
|
+
source: s(String(d.props?.source ?? "")),
|
|
791
|
+
hidden: !0
|
|
792
|
+
}
|
|
793
|
+
}), r(d.id), o.push({
|
|
794
|
+
id: `${d.id}-light`,
|
|
795
|
+
type: "kitlight",
|
|
796
|
+
data: {
|
|
797
|
+
refCellId: d.id,
|
|
798
|
+
label: String(d.props?.label ?? "Status"),
|
|
799
|
+
okAt: Number(d.props?.okAt ?? 1),
|
|
800
|
+
warnAt: Number(d.props?.warnAt ?? 0),
|
|
801
|
+
status: t?.get(d.id)?.status ?? "off"
|
|
802
|
+
}
|
|
803
|
+
}), u += 1;
|
|
804
|
+
break;
|
|
805
|
+
case "kitchart":
|
|
806
|
+
o.push({
|
|
807
|
+
id: d.id,
|
|
808
|
+
type: "expr",
|
|
809
|
+
data: {
|
|
810
|
+
name: String(d.props?.title ?? "chart"),
|
|
811
|
+
source: s(String(d.props?.source ?? "")),
|
|
812
|
+
hidden: !0
|
|
813
|
+
}
|
|
814
|
+
}), r(d.id), o.push({
|
|
815
|
+
id: `${d.id}-plot`,
|
|
816
|
+
type: "chart",
|
|
817
|
+
data: {
|
|
818
|
+
refCellIds: [d.id],
|
|
819
|
+
kind: String(d.props?.kind ?? "line"),
|
|
820
|
+
title: String(d.props?.title ?? ""),
|
|
821
|
+
labels: String(d.props?.labels ?? "")
|
|
822
|
+
}
|
|
823
|
+
}), u += 1;
|
|
824
|
+
break;
|
|
825
|
+
case "textfield":
|
|
826
|
+
case "radio":
|
|
827
|
+
case "checklist":
|
|
828
|
+
case "dropdown":
|
|
829
|
+
case "toggle": {
|
|
830
|
+
let e = $[d.type];
|
|
831
|
+
o.push({
|
|
832
|
+
id: d.id,
|
|
833
|
+
type: "kitinput",
|
|
834
|
+
data: {
|
|
835
|
+
kind: d.type,
|
|
836
|
+
name: String(d.props?.name ?? d.type),
|
|
837
|
+
label: String(d.props?.label ?? d.props?.name ?? d.type),
|
|
838
|
+
opts: b(d.props ?? {}),
|
|
839
|
+
placeholder: String(d.props?.placeholder ?? ""),
|
|
840
|
+
wide: !d.props?.compact,
|
|
841
|
+
value: e(d.props ?? {})
|
|
842
|
+
}
|
|
843
|
+
}), c(d), u += 1;
|
|
844
|
+
break;
|
|
845
|
+
}
|
|
846
|
+
case "location": {
|
|
847
|
+
let e = d.props?.lat, t = d.props?.lng, n = String(d.props?.labeltext ?? ""), r = typeof e == "number" && typeof t == "number" ? `<a href="https://www.openstreetmap.org/?mlat=${e}&mlon=${t}">${e}, ${t}</a>` : "";
|
|
848
|
+
o.push({
|
|
849
|
+
id: d.id,
|
|
850
|
+
type: "paragraph",
|
|
851
|
+
data: { text: [
|
|
852
|
+
`<b>${String(d.props?.name ?? "place")}</b>:`,
|
|
853
|
+
n,
|
|
854
|
+
r
|
|
855
|
+
].filter(Boolean).join(" ") }
|
|
856
|
+
}), c(d), u += 1;
|
|
857
|
+
break;
|
|
858
|
+
}
|
|
859
|
+
case "tooltipcard":
|
|
860
|
+
o.push({
|
|
861
|
+
id: d.id,
|
|
862
|
+
type: "paragraph",
|
|
863
|
+
data: { text: `<b>${String(d.props?.term ?? "")}</b> — ${String(d.props?.tip ?? "")}` }
|
|
864
|
+
}), u += 1;
|
|
865
|
+
break;
|
|
866
|
+
case "linkcard": {
|
|
867
|
+
let e = String(d.props?.url ?? ""), t = e && (/^https?:\/\//.test(e) ? e : `https://${e}`), n = String(d.props?.title ?? "Untitled"), r = String(d.props?.description ?? "");
|
|
868
|
+
o.push({
|
|
869
|
+
id: d.id,
|
|
870
|
+
type: "paragraph",
|
|
871
|
+
data: { text: [t ? `<a href="${t}">${n}</a>` : `<b>${n}</b>`, r].filter(Boolean).join(" — ") }
|
|
872
|
+
}), u += 1;
|
|
873
|
+
break;
|
|
874
|
+
}
|
|
875
|
+
case "actionbutton": {
|
|
876
|
+
let e = String(d.props?.action ?? "increment"), t = String(d.props?.btnlabel ?? "Button");
|
|
877
|
+
if (e === "link") {
|
|
878
|
+
let n = String(d.props?.url ?? "");
|
|
879
|
+
n && o.push({
|
|
880
|
+
id: d.id,
|
|
881
|
+
type: "kitbutton",
|
|
882
|
+
data: {
|
|
883
|
+
label: t,
|
|
884
|
+
action: e,
|
|
885
|
+
url: /^https?:\/\//.test(n) ? n : `https://${n}`
|
|
886
|
+
}
|
|
887
|
+
}), u += 1;
|
|
888
|
+
break;
|
|
889
|
+
}
|
|
890
|
+
let n = i.find((e) => e.name === String(d.props?.target ?? ""));
|
|
891
|
+
if (n) {
|
|
892
|
+
let r = a.get(n.id) ?? {};
|
|
893
|
+
o.push({
|
|
894
|
+
id: d.id,
|
|
895
|
+
type: "kitbutton",
|
|
896
|
+
data: {
|
|
897
|
+
label: t,
|
|
898
|
+
action: e,
|
|
899
|
+
target: n.id,
|
|
900
|
+
amount: Number(d.props?.amount ?? 1),
|
|
901
|
+
min: r.min,
|
|
902
|
+
max: r.max
|
|
903
|
+
}
|
|
904
|
+
});
|
|
905
|
+
}
|
|
906
|
+
u += 1;
|
|
907
|
+
break;
|
|
908
|
+
}
|
|
909
|
+
case "choicecards":
|
|
910
|
+
case "searchselect":
|
|
911
|
+
case "tagfield": {
|
|
912
|
+
let e = $[d.type], t = e(d.props ?? {}), n = b(d.props ?? {}), r = (e) => n.find((t) => t.value === e)?.label ?? e, i = Array.isArray(t) ? t.map(r).join(", ") : t ? r(String(t)) : "—", a = String(d.props?.label ?? d.props?.name ?? d.type);
|
|
913
|
+
o.push({
|
|
914
|
+
id: d.id,
|
|
915
|
+
type: "paragraph",
|
|
916
|
+
data: { text: `<b>${a}:</b> ${K([{ t: i }])}` }
|
|
917
|
+
}), c(d), u += 1;
|
|
918
|
+
break;
|
|
919
|
+
}
|
|
920
|
+
case "longtext":
|
|
921
|
+
case "richtext": {
|
|
922
|
+
let e = d.type === "richtext" && Array.isArray(d.props?.runs) ? d.props.runs : [{ t: String(d.props?.value ?? "") }];
|
|
923
|
+
o.push({
|
|
924
|
+
id: d.id,
|
|
925
|
+
type: "paragraph",
|
|
926
|
+
data: { text: K(e) }
|
|
927
|
+
}), c(d), u += 1;
|
|
928
|
+
break;
|
|
929
|
+
}
|
|
930
|
+
case "progressbar":
|
|
931
|
+
o.push({
|
|
932
|
+
id: d.id,
|
|
933
|
+
type: "expr",
|
|
934
|
+
data: {
|
|
935
|
+
name: String(d.props?.label ?? "Progress"),
|
|
936
|
+
source: s(String(d.props?.source ?? "")),
|
|
937
|
+
hidden: !0
|
|
938
|
+
}
|
|
939
|
+
}), r(d.id), o.push({
|
|
940
|
+
id: `${d.id}-bar`,
|
|
941
|
+
type: "kitprogress",
|
|
942
|
+
data: {
|
|
943
|
+
refCellId: d.id,
|
|
944
|
+
label: String(d.props?.label ?? "Progress"),
|
|
945
|
+
max: Number(d.props?.max ?? 100),
|
|
946
|
+
format: String(d.props?.format ?? "percent")
|
|
947
|
+
}
|
|
948
|
+
}), u += 1;
|
|
949
|
+
break;
|
|
950
|
+
case "dbview":
|
|
951
|
+
o.push({
|
|
952
|
+
id: d.id,
|
|
953
|
+
type: "paragraph",
|
|
954
|
+
data: { text: K([{
|
|
955
|
+
t: `🗃 ${String(d.props?.name ?? "Database")}`,
|
|
956
|
+
a: { m: String(d.props?.pageId ?? "") }
|
|
957
|
+
}]) }
|
|
958
|
+
}), u += 1;
|
|
959
|
+
break;
|
|
960
|
+
default: o.push({
|
|
961
|
+
id: d.id,
|
|
962
|
+
type: "paragraph",
|
|
963
|
+
data: { text: K(d.text) }
|
|
964
|
+
}), u += 1;
|
|
965
|
+
}
|
|
966
|
+
}
|
|
967
|
+
};
|
|
968
|
+
return l(e), n;
|
|
969
|
+
}
|
|
970
|
+
function ae(e) {
|
|
971
|
+
if (!e || e.editor !== "blocks" || !e.blockdoc) return e;
|
|
972
|
+
let t = e.blockdoc, n = t.blocks ?? [], i;
|
|
973
|
+
try {
|
|
974
|
+
i = U(r(t));
|
|
975
|
+
} catch {
|
|
976
|
+
i = void 0;
|
|
977
|
+
}
|
|
978
|
+
let a = ie(n, i);
|
|
979
|
+
return {
|
|
980
|
+
...e,
|
|
981
|
+
editorjs: { blocks: a.blocks },
|
|
982
|
+
values: a.values,
|
|
983
|
+
names: a.names
|
|
984
|
+
};
|
|
985
|
+
}
|
|
986
|
+
//#endregion
|
|
987
|
+
export { u as C, c as S, _, z as a, m as b, V as c, D as d, P as f, x as g, w as h, O as i, F as l, H as m, Z as n, L as o, I as p, Q as r, N as s, ae as t, M as u, y as v, d as x, f as y };
|