@nuraly/lumenjs 0.1.2 → 0.1.4
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/README.md +76 -235
- package/dist/auth/config.d.ts +23 -0
- package/dist/auth/config.js +115 -0
- package/dist/auth/guard.d.ts +12 -0
- package/dist/auth/guard.js +28 -0
- package/dist/auth/index.d.ts +3 -0
- package/dist/auth/index.js +1 -0
- package/dist/auth/middleware.d.ts +23 -0
- package/dist/auth/middleware.js +89 -0
- package/dist/auth/native-auth.d.ts +73 -0
- package/dist/auth/native-auth.js +293 -0
- package/dist/auth/oidc-client.d.ts +17 -0
- package/dist/auth/oidc-client.js +123 -0
- package/dist/auth/providers/google.d.ts +23 -0
- package/dist/auth/providers/google.js +25 -0
- package/dist/auth/providers/index.d.ts +2 -0
- package/dist/auth/providers/index.js +1 -0
- package/dist/auth/routes/login.d.ts +8 -0
- package/dist/auth/routes/login.js +98 -0
- package/dist/auth/routes/logout.d.ts +4 -0
- package/dist/auth/routes/logout.js +79 -0
- package/dist/auth/routes/oidc-callback.d.ts +3 -0
- package/dist/auth/routes/oidc-callback.js +70 -0
- package/dist/auth/routes/password.d.ts +5 -0
- package/dist/auth/routes/password.js +149 -0
- package/dist/auth/routes/signup.d.ts +3 -0
- package/dist/auth/routes/signup.js +81 -0
- package/dist/auth/routes/token.d.ts +4 -0
- package/dist/auth/routes/token.js +70 -0
- package/dist/auth/routes/utils.d.ts +7 -0
- package/dist/auth/routes/utils.js +35 -0
- package/dist/auth/routes/verify.d.ts +3 -0
- package/dist/auth/routes/verify.js +26 -0
- package/dist/auth/routes.d.ts +8 -0
- package/dist/auth/routes.js +110 -0
- package/dist/auth/session.d.ts +8 -0
- package/dist/auth/session.js +54 -0
- package/dist/auth/token.d.ts +33 -0
- package/dist/auth/token.js +90 -0
- package/dist/auth/types.d.ts +156 -0
- package/dist/auth/types.js +2 -0
- package/dist/build/build-client.d.ts +15 -0
- package/dist/build/build-client.js +45 -0
- package/dist/build/build-prerender.d.ts +11 -0
- package/dist/build/build-prerender.js +159 -0
- package/dist/build/build-server.d.ts +17 -0
- package/dist/build/build-server.js +98 -0
- package/dist/build/build.js +52 -120
- package/dist/build/scan.d.ts +19 -0
- package/dist/build/scan.js +77 -6
- package/dist/build/serve-api.js +8 -2
- package/dist/build/serve-loaders.d.ts +4 -2
- package/dist/build/serve-loaders.js +128 -10
- package/dist/build/serve-ssr.js +38 -11
- package/dist/build/serve-static.js +3 -3
- package/dist/build/serve.js +229 -14
- package/dist/cli.js +37 -6
- package/dist/communication/encryption.d.ts +35 -0
- package/dist/communication/encryption.js +90 -0
- package/dist/communication/handlers/context.d.ts +27 -0
- package/dist/communication/handlers/context.js +1 -0
- package/dist/communication/handlers/conversation.d.ts +24 -0
- package/dist/communication/handlers/conversation.js +113 -0
- package/dist/communication/handlers/file-upload.d.ts +17 -0
- package/dist/communication/handlers/file-upload.js +62 -0
- package/dist/communication/handlers/messaging.d.ts +30 -0
- package/dist/communication/handlers/messaging.js +237 -0
- package/dist/communication/handlers/presence.d.ts +15 -0
- package/dist/communication/handlers/presence.js +76 -0
- package/dist/communication/handlers.d.ts +5 -0
- package/dist/communication/handlers.js +5 -0
- package/dist/communication/index.d.ts +9 -0
- package/dist/communication/index.js +7 -0
- package/dist/communication/link-preview.d.ts +18 -0
- package/dist/communication/link-preview.js +115 -0
- package/dist/communication/schema.d.ts +10 -0
- package/dist/communication/schema.js +101 -0
- package/dist/communication/server.d.ts +86 -0
- package/dist/communication/server.js +212 -0
- package/dist/communication/signaling.d.ts +43 -0
- package/dist/communication/signaling.js +271 -0
- package/dist/communication/store.d.ts +71 -0
- package/dist/communication/store.js +289 -0
- package/dist/communication/types.d.ts +454 -0
- package/dist/communication/types.js +1 -0
- package/dist/create.d.ts +1 -0
- package/dist/create.js +55 -0
- package/dist/db/auto-migrate.d.ts +3 -0
- package/dist/db/auto-migrate.js +100 -0
- package/dist/db/client.d.ts +3 -0
- package/dist/db/client.js +18 -0
- package/dist/db/context.d.ts +2 -0
- package/dist/db/context.js +9 -0
- package/dist/db/index.d.ts +23 -0
- package/dist/db/index.js +258 -0
- package/dist/db/seed.d.ts +12 -0
- package/dist/db/seed.js +88 -0
- package/dist/db/table.d.ts +10 -0
- package/dist/db/table.js +12 -0
- package/dist/dev-server/config.d.ts +14 -0
- package/dist/dev-server/config.js +26 -9
- package/dist/dev-server/index-html.d.ts +3 -0
- package/dist/dev-server/index-html.js +18 -6
- package/dist/dev-server/nuralyui-aliases.d.ts +0 -4
- package/dist/dev-server/nuralyui-aliases.js +115 -94
- package/dist/dev-server/plugins/vite-plugin-api-routes.js +29 -5
- package/dist/dev-server/plugins/vite-plugin-auth.d.ts +6 -0
- package/dist/dev-server/plugins/vite-plugin-auth.js +223 -0
- package/dist/dev-server/plugins/vite-plugin-auto-define.d.ts +16 -0
- package/dist/dev-server/plugins/vite-plugin-auto-define.js +111 -0
- package/dist/dev-server/plugins/vite-plugin-communication.d.ts +6 -0
- package/dist/dev-server/plugins/vite-plugin-communication.js +205 -0
- package/dist/dev-server/plugins/vite-plugin-editor-api.d.ts +6 -0
- package/dist/dev-server/plugins/vite-plugin-editor-api.js +318 -0
- package/dist/dev-server/plugins/vite-plugin-i18n.js +69 -2
- package/dist/dev-server/plugins/vite-plugin-lit-dedup.d.ts +6 -0
- package/dist/dev-server/plugins/vite-plugin-lit-dedup.js +78 -34
- package/dist/dev-server/plugins/vite-plugin-lit-hmr.js +44 -2
- package/dist/dev-server/plugins/vite-plugin-llms.d.ts +2 -0
- package/dist/dev-server/plugins/vite-plugin-llms.js +92 -0
- package/dist/dev-server/plugins/vite-plugin-loaders.d.ts +0 -1
- package/dist/dev-server/plugins/vite-plugin-loaders.js +311 -42
- package/dist/dev-server/plugins/vite-plugin-routes.js +18 -6
- package/dist/dev-server/plugins/vite-plugin-socketio.d.ts +2 -0
- package/dist/dev-server/plugins/vite-plugin-socketio.js +51 -0
- package/dist/dev-server/plugins/vite-plugin-source-annotator.d.ts +2 -0
- package/dist/dev-server/plugins/vite-plugin-source-annotator.js +26 -3
- package/dist/dev-server/plugins/vite-plugin-storage.d.ts +10 -0
- package/dist/dev-server/plugins/vite-plugin-storage.js +126 -0
- package/dist/dev-server/plugins/vite-plugin-virtual-modules.js +111 -2
- package/dist/dev-server/server.js +128 -12
- package/dist/dev-server/ssr-render.d.ts +2 -1
- package/dist/dev-server/ssr-render.js +107 -48
- package/dist/editor/ai/backend.d.ts +20 -0
- package/dist/editor/ai/backend.js +104 -0
- package/dist/editor/ai/claude-code-client.d.ts +20 -0
- package/dist/editor/ai/claude-code-client.js +145 -0
- package/dist/editor/ai/opencode-client.d.ts +14 -0
- package/dist/editor/ai/opencode-client.js +125 -0
- package/dist/editor/ai/snapshot-store.d.ts +22 -0
- package/dist/editor/ai/snapshot-store.js +35 -0
- package/dist/editor/ai/types.d.ts +30 -0
- package/dist/editor/ai/types.js +136 -0
- package/dist/editor/ai-chat-panel.d.ts +13 -0
- package/dist/editor/ai-chat-panel.js +587 -0
- package/dist/editor/ai-markdown.d.ts +10 -0
- package/dist/editor/ai-markdown.js +70 -0
- package/dist/editor/ai-project-panel.d.ts +11 -0
- package/dist/editor/ai-project-panel.js +332 -0
- package/dist/editor/ast-modification.d.ts +11 -0
- package/dist/editor/ast-modification.js +1 -0
- package/dist/editor/ast-service.d.ts +30 -0
- package/dist/editor/ast-service.js +180 -0
- package/dist/editor/css-rules.d.ts +54 -0
- package/dist/editor/css-rules.js +423 -0
- package/dist/editor/editor-api-client.d.ts +51 -0
- package/dist/editor/editor-api-client.js +162 -0
- package/dist/editor/editor-bridge.d.ts +1 -0
- package/dist/editor/editor-bridge.js +17 -8
- package/dist/editor/editor-toolbar.d.ts +14 -0
- package/dist/editor/editor-toolbar.js +115 -0
- package/dist/editor/file-editor.d.ts +9 -0
- package/dist/editor/file-editor.js +236 -0
- package/dist/editor/file-service.d.ts +16 -0
- package/dist/editor/file-service.js +52 -0
- package/dist/editor/i18n-key-gen.d.ts +1 -0
- package/dist/editor/i18n-key-gen.js +7 -0
- package/dist/editor/inline-text-edit.d.ts +5 -0
- package/dist/editor/inline-text-edit.js +173 -92
- package/dist/editor/overlay-events.d.ts +5 -0
- package/dist/editor/overlay-events.js +364 -0
- package/dist/editor/overlay-hmr.d.ts +2 -0
- package/dist/editor/overlay-hmr.js +75 -0
- package/dist/editor/overlay-selection.d.ts +29 -0
- package/dist/editor/overlay-selection.js +148 -0
- package/dist/editor/overlay-utils.d.ts +12 -0
- package/dist/editor/overlay-utils.js +59 -0
- package/dist/editor/properties-panel-persist.d.ts +14 -0
- package/dist/editor/properties-panel-persist.js +70 -0
- package/dist/editor/properties-panel-rows.d.ts +10 -0
- package/dist/editor/properties-panel-rows.js +349 -0
- package/dist/editor/properties-panel-styles.d.ts +4 -0
- package/dist/editor/properties-panel-styles.js +174 -0
- package/dist/editor/properties-panel.d.ts +4 -0
- package/dist/editor/properties-panel.js +148 -0
- package/dist/editor/property-registry.d.ts +16 -0
- package/dist/editor/property-registry.js +303 -0
- package/dist/editor/standalone-file-panel.d.ts +0 -0
- package/dist/editor/standalone-file-panel.js +1 -0
- package/dist/editor/standalone-overlay-dom.d.ts +0 -0
- package/dist/editor/standalone-overlay-dom.js +1 -0
- package/dist/editor/standalone-overlay-styles.d.ts +0 -0
- package/dist/editor/standalone-overlay-styles.js +1 -0
- package/dist/editor/standalone-overlay.d.ts +1 -0
- package/dist/editor/standalone-overlay.js +76 -0
- package/dist/editor/syntax-highlighter.d.ts +4 -0
- package/dist/editor/syntax-highlighter.js +81 -0
- package/dist/editor/text-toolbar.d.ts +11 -0
- package/dist/editor/text-toolbar.js +327 -0
- package/dist/editor/toolbar-styles.d.ts +4 -0
- package/dist/editor/toolbar-styles.js +198 -0
- package/dist/email/index.d.ts +32 -0
- package/dist/email/index.js +154 -0
- package/dist/email/providers/resend.d.ts +2 -0
- package/dist/email/providers/resend.js +24 -0
- package/dist/email/providers/sendgrid.d.ts +2 -0
- package/dist/email/providers/sendgrid.js +31 -0
- package/dist/email/providers/smtp.d.ts +13 -0
- package/dist/email/providers/smtp.js +125 -0
- package/dist/email/template-engine.d.ts +18 -0
- package/dist/email/template-engine.js +116 -0
- package/dist/email/templates/base.d.ts +9 -0
- package/dist/email/templates/base.js +65 -0
- package/dist/email/templates/password-reset.d.ts +5 -0
- package/dist/email/templates/password-reset.js +15 -0
- package/dist/email/templates/verify-email.d.ts +5 -0
- package/dist/email/templates/verify-email.js +15 -0
- package/dist/email/templates/welcome.d.ts +5 -0
- package/dist/email/templates/welcome.js +13 -0
- package/dist/email/types.d.ts +49 -0
- package/dist/email/types.js +1 -0
- package/dist/llms/generate.d.ts +46 -0
- package/dist/llms/generate.js +185 -0
- package/dist/permissions/guard.d.ts +28 -0
- package/dist/permissions/guard.js +30 -0
- package/dist/permissions/index.d.ts +6 -0
- package/dist/permissions/index.js +3 -0
- package/dist/permissions/service.d.ts +80 -0
- package/dist/permissions/service.js +210 -0
- package/dist/permissions/tables.d.ts +5 -0
- package/dist/permissions/tables.js +68 -0
- package/dist/permissions/types.d.ts +33 -0
- package/dist/permissions/types.js +1 -0
- package/dist/runtime/app-shell.js +163 -0
- package/dist/runtime/auth.d.ts +10 -0
- package/dist/runtime/auth.js +30 -0
- package/dist/runtime/communication.d.ts +137 -0
- package/dist/runtime/communication.js +228 -0
- package/dist/runtime/error-boundary.d.ts +23 -0
- package/dist/runtime/error-boundary.js +120 -0
- package/dist/runtime/i18n.d.ts +6 -1
- package/dist/runtime/i18n.js +42 -21
- package/dist/runtime/router-data.d.ts +5 -0
- package/dist/runtime/router-data.js +121 -16
- package/dist/runtime/router-hydration.js +25 -0
- package/dist/runtime/router.d.ts +21 -1
- package/dist/runtime/router.js +221 -39
- package/dist/runtime/socket-client.d.ts +2 -0
- package/dist/runtime/socket-client.js +30 -0
- package/dist/runtime/webrtc.d.ts +47 -0
- package/dist/runtime/webrtc.js +178 -0
- package/dist/shared/graceful-shutdown.d.ts +8 -0
- package/dist/shared/graceful-shutdown.js +36 -0
- package/dist/shared/health.d.ts +8 -0
- package/dist/shared/health.js +25 -0
- package/dist/shared/llms-txt.d.ts +31 -0
- package/dist/shared/llms-txt.js +85 -0
- package/dist/shared/logger.d.ts +32 -0
- package/dist/shared/logger.js +93 -0
- package/dist/shared/meta.d.ts +27 -0
- package/dist/shared/meta.js +71 -0
- package/dist/shared/middleware-runner.d.ts +9 -0
- package/dist/shared/middleware-runner.js +29 -0
- package/dist/shared/rate-limit.d.ts +18 -0
- package/dist/shared/rate-limit.js +71 -0
- package/dist/shared/request-id.d.ts +5 -0
- package/dist/shared/request-id.js +18 -0
- package/dist/shared/route-matching.js +16 -1
- package/dist/shared/security-headers.d.ts +18 -0
- package/dist/shared/security-headers.js +38 -0
- package/dist/shared/socket-io-setup.d.ts +11 -0
- package/dist/shared/socket-io-setup.js +51 -0
- package/dist/shared/types.d.ts +16 -0
- package/dist/shared/utils.d.ts +37 -7
- package/dist/shared/utils.js +175 -26
- package/dist/storage/adapters/local.d.ts +44 -0
- package/dist/storage/adapters/local.js +85 -0
- package/dist/storage/adapters/s3.d.ts +32 -0
- package/dist/storage/adapters/s3.js +116 -0
- package/dist/storage/adapters/types.d.ts +53 -0
- package/dist/storage/adapters/types.js +1 -0
- package/dist/storage/index.d.ts +76 -0
- package/dist/storage/index.js +83 -0
- package/package.json +20 -1
- package/templates/blog/api/posts.ts +6 -0
- package/templates/blog/data/migrations/001_init.sql +13 -0
- package/templates/blog/lumenjs.config.ts +3 -0
- package/templates/blog/package.json +14 -0
- package/templates/blog/pages/_layout.ts +25 -0
- package/templates/blog/pages/index.ts +65 -0
- package/templates/blog/pages/posts/[slug].ts +60 -0
- package/templates/blog/pages/tag/[tag].ts +44 -0
- package/templates/dashboard/api/stats.ts +10 -0
- package/templates/dashboard/data/migrations/001_init.sql +13 -0
- package/templates/dashboard/lumenjs.config.ts +3 -0
- package/templates/dashboard/package.json +14 -0
- package/templates/dashboard/pages/_layout.ts +25 -0
- package/templates/dashboard/pages/index.ts +72 -0
- package/templates/dashboard/pages/settings/index.ts +29 -0
- package/templates/default/lumenjs.config.ts +3 -0
- package/templates/default/package.json +14 -0
- package/templates/default/pages/index.ts +24 -0
- package/templates/social/api/posts/[id].ts +14 -0
- package/templates/social/api/posts.ts +11 -0
- package/templates/social/api/profile/[username].ts +10 -0
- package/templates/social/api/upload.ts +19 -0
- package/templates/social/data/migrations/001_init.sql +78 -0
- package/templates/social/data/migrations/002_add_image_url.sql +1 -0
- package/templates/social/data/migrations/003_auth.sql +7 -0
- package/templates/social/docs/architecture.md +76 -0
- package/templates/social/docs/components.md +100 -0
- package/templates/social/docs/data.md +89 -0
- package/templates/social/docs/pages.md +96 -0
- package/templates/social/docs/theming.md +52 -0
- package/templates/social/lib/media.ts +130 -0
- package/templates/social/lumenjs.auth.ts +21 -0
- package/templates/social/lumenjs.config.ts +3 -0
- package/templates/social/package.json +5 -0
- package/templates/social/pages/_layout.ts +239 -0
- package/templates/social/pages/apps/[id].ts +173 -0
- package/templates/social/pages/apps/index.ts +116 -0
- package/templates/social/pages/auth/login.ts +92 -0
- package/templates/social/pages/bookmarks.ts +57 -0
- package/templates/social/pages/explore.ts +73 -0
- package/templates/social/pages/index.ts +351 -0
- package/templates/social/pages/messages.ts +298 -0
- package/templates/social/pages/new.ts +77 -0
- package/templates/social/pages/notifications.ts +73 -0
- package/templates/social/pages/post/[id].ts +124 -0
- package/templates/social/pages/profile/[username].ts +100 -0
- package/templates/social/pages/settings/accessibility.ts +153 -0
- package/templates/social/pages/settings/account.ts +260 -0
- package/templates/social/pages/settings/help.ts +141 -0
- package/templates/social/pages/settings/language.ts +103 -0
- package/templates/social/pages/settings/privacy.ts +183 -0
- package/templates/social/pages/settings/security.ts +133 -0
- package/templates/social/pages/settings.ts +185 -0
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Property Registry — static enum registry + runtime property discovery
|
|
3
|
+
* for the right-side properties panel.
|
|
4
|
+
*/
|
|
5
|
+
export interface PropertyInfo {
|
|
6
|
+
name: string;
|
|
7
|
+
attrName: string;
|
|
8
|
+
type: 'Boolean' | 'String' | 'Number' | 'Array' | 'Object';
|
|
9
|
+
value: unknown;
|
|
10
|
+
enumValues?: string[];
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* Discover editable properties for any HTML element.
|
|
14
|
+
* Three-tier: Lit custom elements → unknown custom elements → standard HTML.
|
|
15
|
+
*/
|
|
16
|
+
export declare function discoverProperties(element: HTMLElement): PropertyInfo[];
|
|
@@ -0,0 +1,303 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Property Registry — static enum registry + runtime property discovery
|
|
3
|
+
* for the right-side properties panel.
|
|
4
|
+
*/
|
|
5
|
+
/** Enum values for nr-* components, extracted from *.types.ts files */
|
|
6
|
+
const PROPERTY_ENUMS = {
|
|
7
|
+
'nr-button': {
|
|
8
|
+
type: ['primary', 'secondary', 'danger', 'ghost', 'default'],
|
|
9
|
+
size: ['small', 'medium', 'large'],
|
|
10
|
+
shape: ['default', 'circle', 'round'],
|
|
11
|
+
iconPosition: ['left', 'right'],
|
|
12
|
+
},
|
|
13
|
+
'nr-input': {
|
|
14
|
+
state: ['default', 'error', 'warning', 'success'],
|
|
15
|
+
size: ['large', 'medium', 'small'],
|
|
16
|
+
variant: ['outlined', 'filled', 'borderless', 'underlined'],
|
|
17
|
+
type: ['password', 'text', 'number', 'email', 'url', 'tel', 'search', 'calendar'],
|
|
18
|
+
},
|
|
19
|
+
'nr-select': {
|
|
20
|
+
state: ['error', 'warning', 'success'],
|
|
21
|
+
type: ['default', 'inline', 'button', 'slot'],
|
|
22
|
+
status: ['default', 'warning', 'error', 'success'],
|
|
23
|
+
size: ['small', 'medium', 'large'],
|
|
24
|
+
direction: ['horizontal', 'vertical'],
|
|
25
|
+
variant: ['default', 'solid', 'outline', 'borderless'],
|
|
26
|
+
placement: ['bottom', 'top', 'auto'],
|
|
27
|
+
searchMode: ['none', 'starts-with', 'contains', 'fuzzy'],
|
|
28
|
+
},
|
|
29
|
+
'nr-card': {
|
|
30
|
+
size: ['small', 'default', 'large'],
|
|
31
|
+
},
|
|
32
|
+
'nr-tabs': {
|
|
33
|
+
orientation: ['horizontal', 'vertical'],
|
|
34
|
+
align: ['right', 'left', 'center', 'stretch'],
|
|
35
|
+
size: ['small', 'medium', 'large'],
|
|
36
|
+
type: ['default', 'card', 'line', 'bordered'],
|
|
37
|
+
},
|
|
38
|
+
'nr-alert': {
|
|
39
|
+
type: ['success', 'info', 'warning', 'error'],
|
|
40
|
+
},
|
|
41
|
+
'nr-tag': {
|
|
42
|
+
color: ['magenta', 'red', 'volcano', 'orange', 'gold', 'lime', 'green', 'cyan', 'blue', 'geekblue', 'purple'],
|
|
43
|
+
size: ['default', 'small'],
|
|
44
|
+
},
|
|
45
|
+
'nr-badge': {
|
|
46
|
+
status: ['success', 'processing', 'default', 'error', 'warning'],
|
|
47
|
+
size: ['default', 'small'],
|
|
48
|
+
color: ['pink', 'red', 'yellow', 'orange', 'cyan', 'green', 'blue', 'purple', 'geekblue', 'magenta', 'volcano', 'gold', 'lime'],
|
|
49
|
+
ribbonPlacement: ['start', 'end'],
|
|
50
|
+
},
|
|
51
|
+
'nr-checkbox': {
|
|
52
|
+
size: ['small', 'medium', 'large'],
|
|
53
|
+
},
|
|
54
|
+
'nr-radio': {
|
|
55
|
+
size: ['small', 'medium', 'large'],
|
|
56
|
+
},
|
|
57
|
+
'nr-radio-group': {
|
|
58
|
+
state: ['error', 'warning'],
|
|
59
|
+
direction: ['horizontal', 'vertical'],
|
|
60
|
+
position: ['left', 'right'],
|
|
61
|
+
type: ['default', 'button', 'slot', 'button-slot'],
|
|
62
|
+
size: ['small', 'medium', 'large'],
|
|
63
|
+
variant: ['default', 'solid'],
|
|
64
|
+
},
|
|
65
|
+
'nr-divider': {
|
|
66
|
+
type: ['horizontal', 'vertical'],
|
|
67
|
+
orientation: ['start', 'center', 'end'],
|
|
68
|
+
variant: ['solid', 'dashed', 'dotted'],
|
|
69
|
+
size: ['small', 'middle', 'large'],
|
|
70
|
+
},
|
|
71
|
+
'nr-label': {
|
|
72
|
+
size: ['small', 'medium', 'large'],
|
|
73
|
+
variant: ['default', 'secondary', 'success', 'warning', 'error'],
|
|
74
|
+
},
|
|
75
|
+
'nr-icon': {
|
|
76
|
+
type: ['solid', 'regular'],
|
|
77
|
+
},
|
|
78
|
+
'nr-image': {
|
|
79
|
+
fit: ['none', 'fill', 'contain', 'cover', 'scale-down'],
|
|
80
|
+
placeholder: ['default', 'custom'],
|
|
81
|
+
},
|
|
82
|
+
'nr-video': {
|
|
83
|
+
controls: ['show', 'hide', 'hover'],
|
|
84
|
+
preload: ['none', 'metadata', 'auto'],
|
|
85
|
+
},
|
|
86
|
+
'nr-dropdown': {
|
|
87
|
+
placement: ['bottom', 'top', 'bottom-start', 'bottom-end', 'top-start', 'top-end', 'auto'],
|
|
88
|
+
trigger: ['click', 'hover', 'focus', 'manual'],
|
|
89
|
+
size: ['small', 'medium', 'large'],
|
|
90
|
+
animation: ['none', 'fade', 'slide', 'scale'],
|
|
91
|
+
},
|
|
92
|
+
'nr-menu': {
|
|
93
|
+
size: ['small', 'medium', 'large'],
|
|
94
|
+
iconPosition: ['left', 'right'],
|
|
95
|
+
},
|
|
96
|
+
'nr-breadcrumb': {
|
|
97
|
+
separator: ['/', '>', '›', '-', '•'],
|
|
98
|
+
},
|
|
99
|
+
'nr-modal': {
|
|
100
|
+
size: ['small', 'medium', 'large', 'xl'],
|
|
101
|
+
position: ['center', 'top', 'bottom'],
|
|
102
|
+
animation: ['fade', 'zoom', 'slide-up', 'slide-down', 'none'],
|
|
103
|
+
backdrop: ['static', 'closable', 'none'],
|
|
104
|
+
},
|
|
105
|
+
'nr-popconfirm': {
|
|
106
|
+
placement: ['top', 'top-start', 'top-end', 'bottom', 'bottom-start', 'bottom-end', 'left', 'left-start', 'left-end', 'right', 'right-start', 'right-end'],
|
|
107
|
+
trigger: ['click', 'hover', 'focus'],
|
|
108
|
+
buttonType: ['primary', 'secondary', 'danger', 'default'],
|
|
109
|
+
icon: ['exclamation-circle', 'question-circle', 'info-circle', 'close-circle', 'check-circle'],
|
|
110
|
+
},
|
|
111
|
+
'nr-toast': {
|
|
112
|
+
type: ['default', 'success', 'error', 'warning', 'info'],
|
|
113
|
+
position: ['top-right', 'top-left', 'top-center', 'bottom-right', 'bottom-left', 'bottom-center'],
|
|
114
|
+
animation: ['fade', 'slide', 'bounce'],
|
|
115
|
+
},
|
|
116
|
+
'nr-skeleton': {
|
|
117
|
+
shape: ['circle', 'square', 'round', 'default'],
|
|
118
|
+
size: ['small', 'default', 'large'],
|
|
119
|
+
elementType: ['avatar', 'button', 'input', 'image'],
|
|
120
|
+
},
|
|
121
|
+
'nr-timeline': {
|
|
122
|
+
mode: ['left', 'right', 'alternate'],
|
|
123
|
+
color: ['blue', 'red', 'green', 'gray'],
|
|
124
|
+
position: ['left', 'right'],
|
|
125
|
+
},
|
|
126
|
+
'nr-table': {
|
|
127
|
+
filterType: ['text', 'select', 'number', 'date'],
|
|
128
|
+
selectionMode: ['single', 'multiple'],
|
|
129
|
+
size: ['small', 'normal', 'large'],
|
|
130
|
+
},
|
|
131
|
+
'nr-form': {
|
|
132
|
+
validationState: ['pristine', 'pending', 'valid', 'invalid', 'submitted'],
|
|
133
|
+
submissionState: ['idle', 'submitting', 'success', 'error'],
|
|
134
|
+
},
|
|
135
|
+
'nr-flex': {
|
|
136
|
+
direction: ['row', 'row-reverse', 'column', 'column-reverse'],
|
|
137
|
+
wrap: ['nowrap', 'wrap', 'wrap-reverse'],
|
|
138
|
+
justify: ['flex-start', 'flex-end', 'center', 'space-between', 'space-around', 'space-evenly'],
|
|
139
|
+
align: ['flex-start', 'flex-end', 'center', 'baseline', 'stretch'],
|
|
140
|
+
gap: ['small', 'medium', 'large'],
|
|
141
|
+
},
|
|
142
|
+
'nr-grid': {
|
|
143
|
+
breakpoint: ['xs', 'sm', 'md', 'lg', 'xl', 'xxl'],
|
|
144
|
+
align: ['top', 'middle', 'bottom', 'stretch'],
|
|
145
|
+
justify: ['start', 'end', 'center', 'space-around', 'space-between', 'space-evenly'],
|
|
146
|
+
},
|
|
147
|
+
'nr-layout': {
|
|
148
|
+
breakpoint: ['xs', 'sm', 'md', 'lg', 'xl', 'xxl'],
|
|
149
|
+
siderTheme: ['light', 'dark'],
|
|
150
|
+
},
|
|
151
|
+
'nr-panel': {
|
|
152
|
+
mode: ['panel', 'window', 'minimized', 'embedded'],
|
|
153
|
+
size: ['small', 'medium', 'large', 'custom'],
|
|
154
|
+
position: ['left', 'right', 'bottom', 'top'],
|
|
155
|
+
maximizePosition: ['center', 'left', 'right', 'top-left', 'top-right', 'bottom-left', 'bottom-right'],
|
|
156
|
+
},
|
|
157
|
+
'nr-container': {
|
|
158
|
+
layout: ['fluid', 'boxed', 'fixed'],
|
|
159
|
+
direction: ['row', 'column'],
|
|
160
|
+
size: ['sm', 'md', 'lg', 'xl', 'full'],
|
|
161
|
+
padding: ['none', 'sm', 'md', 'lg'],
|
|
162
|
+
justify: ['flex-start', 'flex-end', 'center', 'space-between', 'space-around', 'space-evenly'],
|
|
163
|
+
align: ['flex-start', 'flex-end', 'center', 'baseline', 'stretch'],
|
|
164
|
+
},
|
|
165
|
+
'nr-slider-input': {
|
|
166
|
+
size: ['small', 'medium', 'large'],
|
|
167
|
+
variant: ['default', 'primary', 'success', 'warning', 'error'],
|
|
168
|
+
},
|
|
169
|
+
'nr-datepicker': {
|
|
170
|
+
state: ['error', 'warning', 'success'],
|
|
171
|
+
mode: ['day', 'month', 'year', 'decade'],
|
|
172
|
+
type: ['single', 'range', 'multiple'],
|
|
173
|
+
size: ['small', 'medium', 'large'],
|
|
174
|
+
variant: ['default', 'outlined', 'filled'],
|
|
175
|
+
format: ['YYYY-MM-DD', 'MM/DD/YYYY', 'DD/MM/YYYY', 'DD/MM/YY', 'DD MMMM YYYY', 'DD MMM YYYY'],
|
|
176
|
+
placement: ['bottom', 'top', 'auto'],
|
|
177
|
+
},
|
|
178
|
+
'nr-timepicker': {
|
|
179
|
+
timeFormat: ['24h', '12h'],
|
|
180
|
+
mode: ['hours', 'minutes', 'seconds'],
|
|
181
|
+
size: ['small', 'medium', 'large'],
|
|
182
|
+
variant: ['default', 'outlined', 'filled'],
|
|
183
|
+
state: ['default', 'error', 'warning', 'success'],
|
|
184
|
+
placement: ['bottom', 'top', 'auto'],
|
|
185
|
+
},
|
|
186
|
+
'nr-colorpicker': {
|
|
187
|
+
size: ['default', 'small', 'large'],
|
|
188
|
+
trigger: ['click', 'hover', 'manual'],
|
|
189
|
+
placement: ['top', 'bottom', 'auto'],
|
|
190
|
+
animation: ['none', 'fade', 'slide', 'scale'],
|
|
191
|
+
format: ['hex', 'rgb', 'rgba', 'hsl', 'hsla'],
|
|
192
|
+
},
|
|
193
|
+
'nr-textarea': {
|
|
194
|
+
state: ['default', 'error', 'warning', 'success'],
|
|
195
|
+
size: ['large', 'medium', 'small'],
|
|
196
|
+
variant: ['outlined', 'filled', 'borderless', 'underlined'],
|
|
197
|
+
resize: ['none', 'vertical', 'horizontal', 'both'],
|
|
198
|
+
},
|
|
199
|
+
'nr-iconpicker': {
|
|
200
|
+
size: ['small', 'medium', 'large'],
|
|
201
|
+
placement: ['auto', 'top', 'bottom', 'top-start', 'top-end', 'bottom-start', 'bottom-end', 'left', 'right'],
|
|
202
|
+
trigger: ['click', 'hover', 'manual'],
|
|
203
|
+
iconType: ['solid', 'regular', 'brands'],
|
|
204
|
+
},
|
|
205
|
+
'nr-file-upload': {
|
|
206
|
+
size: ['small', 'medium', 'large'],
|
|
207
|
+
},
|
|
208
|
+
};
|
|
209
|
+
/** HTML attribute enum values for standard elements */
|
|
210
|
+
const HTML_ATTR_ENUMS = {
|
|
211
|
+
target: ['_self', '_blank', '_parent', '_top'],
|
|
212
|
+
type: ['text', 'password', 'email', 'number', 'tel', 'url', 'search', 'date', 'time', 'datetime-local', 'month', 'week', 'color', 'file', 'range', 'hidden', 'checkbox', 'radio', 'submit', 'reset', 'button'],
|
|
213
|
+
loading: ['lazy', 'eager'],
|
|
214
|
+
decoding: ['sync', 'async', 'auto'],
|
|
215
|
+
crossorigin: ['anonymous', 'use-credentials'],
|
|
216
|
+
referrerpolicy: ['no-referrer', 'no-referrer-when-downgrade', 'origin', 'origin-when-cross-origin', 'same-origin', 'strict-origin', 'strict-origin-when-cross-origin', 'unsafe-url'],
|
|
217
|
+
autocomplete: ['on', 'off'],
|
|
218
|
+
dir: ['ltr', 'rtl', 'auto'],
|
|
219
|
+
draggable: ['true', 'false'],
|
|
220
|
+
contenteditable: ['true', 'false'],
|
|
221
|
+
inputmode: ['none', 'text', 'decimal', 'numeric', 'tel', 'search', 'email', 'url'],
|
|
222
|
+
wrap: ['hard', 'soft'],
|
|
223
|
+
method: ['get', 'post', 'dialog'],
|
|
224
|
+
enctype: ['application/x-www-form-urlencoded', 'multipart/form-data', 'text/plain'],
|
|
225
|
+
rel: ['noopener', 'noreferrer', 'nofollow', 'external', 'stylesheet', 'icon'],
|
|
226
|
+
};
|
|
227
|
+
/** Properties to hide from the panel */
|
|
228
|
+
const HIDDEN_PROPS = new Set([
|
|
229
|
+
'currentTheme', 'requiredComponents', 'styles', 'renderOptions',
|
|
230
|
+
'shadowRootOptions', 'elementStyles', 'properties', 'localizeDir',
|
|
231
|
+
'isUpdatePending', 'hasUpdated', 'updateComplete',
|
|
232
|
+
]);
|
|
233
|
+
/**
|
|
234
|
+
* Discover editable properties for any HTML element.
|
|
235
|
+
* Three-tier: Lit custom elements → unknown custom elements → standard HTML.
|
|
236
|
+
*/
|
|
237
|
+
export function discoverProperties(element) {
|
|
238
|
+
const tag = element.tagName.toLowerCase();
|
|
239
|
+
const isCustom = tag.includes('-');
|
|
240
|
+
if (isCustom) {
|
|
241
|
+
// Try Lit element discovery via elementProperties
|
|
242
|
+
const ctor = customElements.get(tag);
|
|
243
|
+
if (ctor?.elementProperties) {
|
|
244
|
+
return discoverLitProperties(element, tag, ctor.elementProperties);
|
|
245
|
+
}
|
|
246
|
+
}
|
|
247
|
+
// Fallback: read DOM attributes (for unknown custom elements and standard HTML)
|
|
248
|
+
return discoverDomAttributes(element, tag);
|
|
249
|
+
}
|
|
250
|
+
function discoverLitProperties(element, tag, propMap) {
|
|
251
|
+
const props = [];
|
|
252
|
+
const enumMap = PROPERTY_ENUMS[tag];
|
|
253
|
+
for (const [name, declaration] of propMap) {
|
|
254
|
+
// Skip internal state
|
|
255
|
+
if (declaration.state === true)
|
|
256
|
+
continue;
|
|
257
|
+
// Skip hidden / private
|
|
258
|
+
if (HIDDEN_PROPS.has(name) || name.startsWith('_') || name.startsWith('__'))
|
|
259
|
+
continue;
|
|
260
|
+
const typeCtor = declaration.type;
|
|
261
|
+
let type = 'String';
|
|
262
|
+
if (typeCtor === Boolean)
|
|
263
|
+
type = 'Boolean';
|
|
264
|
+
else if (typeCtor === Number)
|
|
265
|
+
type = 'Number';
|
|
266
|
+
else if (typeCtor === Array)
|
|
267
|
+
type = 'Array';
|
|
268
|
+
else if (typeCtor === Object)
|
|
269
|
+
type = 'Object';
|
|
270
|
+
// Resolve attribute name (Lit may use a custom attribute name)
|
|
271
|
+
let attrName = declaration.attribute;
|
|
272
|
+
if (attrName === undefined || attrName === true) {
|
|
273
|
+
// Default: lowercase prop name
|
|
274
|
+
attrName = name.toLowerCase();
|
|
275
|
+
}
|
|
276
|
+
else if (attrName === false) {
|
|
277
|
+
// Not reflected — still show but use prop name as attr
|
|
278
|
+
attrName = name.toLowerCase();
|
|
279
|
+
}
|
|
280
|
+
const value = element[name];
|
|
281
|
+
const enumValues = enumMap?.[name];
|
|
282
|
+
props.push({ name, attrName, type, value, enumValues });
|
|
283
|
+
}
|
|
284
|
+
return props;
|
|
285
|
+
}
|
|
286
|
+
function discoverDomAttributes(element, tag) {
|
|
287
|
+
const props = [];
|
|
288
|
+
for (const attr of Array.from(element.attributes)) {
|
|
289
|
+
if (attr.name.startsWith('data-nk-'))
|
|
290
|
+
continue;
|
|
291
|
+
if (attr.name === 'class' || attr.name === 'style')
|
|
292
|
+
continue;
|
|
293
|
+
const enumValues = HTML_ATTR_ENUMS[attr.name];
|
|
294
|
+
props.push({
|
|
295
|
+
name: attr.name,
|
|
296
|
+
attrName: attr.name,
|
|
297
|
+
type: 'String',
|
|
298
|
+
value: attr.value,
|
|
299
|
+
enumValues,
|
|
300
|
+
});
|
|
301
|
+
}
|
|
302
|
+
return props;
|
|
303
|
+
}
|
|
File without changes
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";
|
|
File without changes
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";
|
|
File without changes
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function initStandaloneEditor(): void;
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Standalone Editor Overlay — provides a visual editing UI when editor mode
|
|
3
|
+
* runs outside an iframe (direct browsing, not embedded in Studio).
|
|
4
|
+
*
|
|
5
|
+
* Features:
|
|
6
|
+
* - Hover highlight box around annotated elements (mouse)
|
|
7
|
+
* - Tap / click to select element (shows source info in toolbar)
|
|
8
|
+
* - Double-tap / double-click text to inline edit (delegates to inline-text-edit.ts)
|
|
9
|
+
* - Floating toolbar at top with selected element info
|
|
10
|
+
* - File tree panel to browse/edit project files
|
|
11
|
+
* - Full touch support for mobile/tablet
|
|
12
|
+
*
|
|
13
|
+
* This file is now a slim orchestrator that delegates to:
|
|
14
|
+
* - overlay-selection.ts — selection state & logic
|
|
15
|
+
* - overlay-events.ts — mouse, touch, toolbar, keyboard, scroll/resize handlers
|
|
16
|
+
* - overlay-hmr.ts — HMR re-selection & WebSocket listener
|
|
17
|
+
*/
|
|
18
|
+
import { startAnnotator } from './element-annotator.js';
|
|
19
|
+
import { setupInlineTextEdit } from './inline-text-edit.js';
|
|
20
|
+
import { createPropertiesPanel } from './properties-panel.js';
|
|
21
|
+
import { createAiChatPanel } from './ai-chat-panel.js';
|
|
22
|
+
import { createAiProjectPanel } from './ai-project-panel.js';
|
|
23
|
+
import { createOverlay } from './overlay-utils.js';
|
|
24
|
+
import { createTextToolbar, setupTextToolbarHandlers, setTextToolbarSelectedElement, } from './text-toolbar.js';
|
|
25
|
+
import { createToolbar, createFilePanel, setMode, initToolbarRefs, } from './editor-toolbar.js';
|
|
26
|
+
import { selectedElementRef, deselect, setHoverOverlay, setSelectOverlay, } from './overlay-selection.js';
|
|
27
|
+
import { setupMouseEvents, setupTouchEvents, setupToolbarHandlers, setupKeyboardHandlers, setupScrollResize, } from './overlay-events.js';
|
|
28
|
+
import { setupHmrListener } from './overlay-hmr.js';
|
|
29
|
+
let initialized = false;
|
|
30
|
+
export function initStandaloneEditor() {
|
|
31
|
+
if (initialized)
|
|
32
|
+
return;
|
|
33
|
+
initialized = true;
|
|
34
|
+
// Clean up any stale elements from HMR
|
|
35
|
+
document.getElementById('nk-editor-toolbar')?.remove();
|
|
36
|
+
document.getElementById('nk-file-panel')?.remove();
|
|
37
|
+
document.getElementById('nk-file-editor')?.remove();
|
|
38
|
+
document.getElementById('nk-text-toolbar')?.remove();
|
|
39
|
+
document.getElementById('nk-props-panel')?.remove();
|
|
40
|
+
document.getElementById('nk-ai-chat')?.remove();
|
|
41
|
+
document.getElementById('nk-ai-project')?.remove();
|
|
42
|
+
// Create overlays and store them in selection module
|
|
43
|
+
const hoverOverlay = createOverlay('#7c3aed', 'dashed');
|
|
44
|
+
const selectOverlay = createOverlay('#3b82f6', 'solid');
|
|
45
|
+
setHoverOverlay(hoverOverlay);
|
|
46
|
+
setSelectOverlay(selectOverlay);
|
|
47
|
+
// Initialize toolbar refs before creating toolbar
|
|
48
|
+
initToolbarRefs({ selectOverlay, selectedElement: selectedElementRef, deselect });
|
|
49
|
+
setTextToolbarSelectedElement(selectedElementRef);
|
|
50
|
+
// Create UI elements
|
|
51
|
+
const toolbar = createToolbar();
|
|
52
|
+
const filePanel = createFilePanel();
|
|
53
|
+
createTextToolbar();
|
|
54
|
+
setupTextToolbarHandlers();
|
|
55
|
+
createPropertiesPanel();
|
|
56
|
+
createAiChatPanel();
|
|
57
|
+
createAiProjectPanel();
|
|
58
|
+
// Restore saved editor mode
|
|
59
|
+
try {
|
|
60
|
+
const saved = localStorage.getItem('nk-editor-mode');
|
|
61
|
+
if (saved === 'preview')
|
|
62
|
+
setMode(false);
|
|
63
|
+
}
|
|
64
|
+
catch { }
|
|
65
|
+
// Start annotator (assigns data-nk-id to custom elements)
|
|
66
|
+
startAnnotator();
|
|
67
|
+
// Setup inline text editing (double-click + double-tap handled inside)
|
|
68
|
+
setupInlineTextEdit();
|
|
69
|
+
// Wire up all event handlers
|
|
70
|
+
setupMouseEvents();
|
|
71
|
+
setupTouchEvents();
|
|
72
|
+
setupToolbarHandlers(toolbar, filePanel);
|
|
73
|
+
setupKeyboardHandlers(toolbar);
|
|
74
|
+
setupScrollResize();
|
|
75
|
+
setupHmrListener();
|
|
76
|
+
}
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Lightweight syntax highlighter for CodeJar.
|
|
3
|
+
*/
|
|
4
|
+
const KW = new Set([
|
|
5
|
+
'async', 'await', 'break', 'case', 'catch', 'class', 'const', 'continue', 'debugger',
|
|
6
|
+
'default', 'delete', 'do', 'else', 'enum', 'export', 'extends', 'finally', 'for',
|
|
7
|
+
'from', 'function', 'if', 'implements', 'import', 'in', 'instanceof', 'interface',
|
|
8
|
+
'let', 'new', 'of', 'return', 'static', 'super', 'switch', 'this', 'throw', 'try',
|
|
9
|
+
'type', 'typeof', 'var', 'void', 'while', 'with', 'yield',
|
|
10
|
+
]);
|
|
11
|
+
const LIT = new Set(['true', 'false', 'null', 'undefined', 'NaN', 'Infinity']);
|
|
12
|
+
function esc(s) {
|
|
13
|
+
return s.replace(/&/g, '&').replace(/</g, '<').replace(/>/g, '>');
|
|
14
|
+
}
|
|
15
|
+
export function highlightCode(el) {
|
|
16
|
+
const src = el.textContent || '';
|
|
17
|
+
let out = '', i = 0;
|
|
18
|
+
while (i < src.length) {
|
|
19
|
+
// Line comment
|
|
20
|
+
if (src[i] === '/' && src[i + 1] === '/') {
|
|
21
|
+
const e = src.indexOf('\n', i);
|
|
22
|
+
const end = e === -1 ? src.length : e;
|
|
23
|
+
out += `<span class="nk-hl-c">${esc(src.slice(i, end))}</span>`;
|
|
24
|
+
i = end;
|
|
25
|
+
continue;
|
|
26
|
+
}
|
|
27
|
+
// Block comment
|
|
28
|
+
if (src[i] === '/' && src[i + 1] === '*') {
|
|
29
|
+
const e = src.indexOf('*/', i + 2);
|
|
30
|
+
const end = e === -1 ? src.length : e + 2;
|
|
31
|
+
out += `<span class="nk-hl-c">${esc(src.slice(i, end))}</span>`;
|
|
32
|
+
i = end;
|
|
33
|
+
continue;
|
|
34
|
+
}
|
|
35
|
+
// String
|
|
36
|
+
if (src[i] === '"' || src[i] === "'" || src[i] === '`') {
|
|
37
|
+
const q = src[i];
|
|
38
|
+
let j = i + 1;
|
|
39
|
+
while (j < src.length) {
|
|
40
|
+
if (src[j] === '\\') {
|
|
41
|
+
j += 2;
|
|
42
|
+
continue;
|
|
43
|
+
}
|
|
44
|
+
if (src[j] === q) {
|
|
45
|
+
j++;
|
|
46
|
+
break;
|
|
47
|
+
}
|
|
48
|
+
if (q !== '`' && src[j] === '\n')
|
|
49
|
+
break;
|
|
50
|
+
j++;
|
|
51
|
+
}
|
|
52
|
+
out += `<span class="nk-hl-s">${esc(src.slice(i, j))}</span>`;
|
|
53
|
+
i = j;
|
|
54
|
+
continue;
|
|
55
|
+
}
|
|
56
|
+
// Word (keyword / literal / identifier)
|
|
57
|
+
if (/[a-zA-Z_$]/.test(src[i])) {
|
|
58
|
+
let j = i;
|
|
59
|
+
while (j < src.length && /[\w$]/.test(src[j]))
|
|
60
|
+
j++;
|
|
61
|
+
const w = src.slice(i, j);
|
|
62
|
+
out += KW.has(w) ? `<span class="nk-hl-k">${w}</span>`
|
|
63
|
+
: LIT.has(w) ? `<span class="nk-hl-l">${w}</span>`
|
|
64
|
+
: esc(w);
|
|
65
|
+
i = j;
|
|
66
|
+
continue;
|
|
67
|
+
}
|
|
68
|
+
// Number
|
|
69
|
+
if (/\d/.test(src[i])) {
|
|
70
|
+
let j = i;
|
|
71
|
+
while (j < src.length && /[\d.xXa-fA-FeEnb_]/.test(src[j]))
|
|
72
|
+
j++;
|
|
73
|
+
out += `<span class="nk-hl-n">${esc(src.slice(i, j))}</span>`;
|
|
74
|
+
i = j;
|
|
75
|
+
continue;
|
|
76
|
+
}
|
|
77
|
+
out += esc(src[i]);
|
|
78
|
+
i++;
|
|
79
|
+
}
|
|
80
|
+
el.innerHTML = out;
|
|
81
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
declare const TEXT_TAGS: Set<string>;
|
|
2
|
+
export declare function setTextToolbarSelectedElement(ref: {
|
|
3
|
+
current: HTMLElement | null;
|
|
4
|
+
}): void;
|
|
5
|
+
export declare function getTextToolbar(): HTMLDivElement;
|
|
6
|
+
export { TEXT_TAGS };
|
|
7
|
+
export declare function createTextToolbar(): HTMLDivElement;
|
|
8
|
+
export declare function positionTextToolbar(el: HTMLElement): void;
|
|
9
|
+
export declare function hideTextToolbar(): void;
|
|
10
|
+
export declare function setupTextToolbarHandlers(): void;
|
|
11
|
+
export declare function showTextToolbarForElement(el: HTMLElement): void;
|