@cocoar/vue-script-editor 1.9.0-script-editor.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.
@@ -0,0 +1,35 @@
1
+ import type * as monaco from 'monaco-editor';
2
+ export declare const COAR_THEME_LIGHT = "coar-light";
3
+ export declare const COAR_THEME_DARK = "coar-dark";
4
+ /**
5
+ * Registers the Cocoar light/dark Monaco themes. Idempotent — safe to call on every mount.
6
+ */
7
+ export declare function ensureCoarThemes(monacoNs: typeof monaco): void;
8
+ export type CoarScriptEditorTheme = 'auto' | 'light' | 'dark';
9
+ /**
10
+ * Resolve the currently-active theme name based on three signals, in priority order:
11
+ * 1. An explicit `.dark-mode` / `.light-mode` class on `<html>` or `<body>` (Cocoar
12
+ * convention — consumers toggle this via their app-level theme switcher).
13
+ * 2. A `data-theme="dark"|"light"` attribute on `<html>` (common third-party convention).
14
+ * 3. OS-level `prefers-color-scheme`.
15
+ *
16
+ * SSR-safe: returns the light theme when `document`/`window` are unavailable.
17
+ */
18
+ export declare function detectAutoTheme(): string;
19
+ /**
20
+ * Resolves the Monaco theme name for a given prop value. For `'auto'`, uses
21
+ * `detectAutoTheme()` (class / attribute / OS). For explicit `'light'`/`'dark'`, returns the
22
+ * corresponding theme unconditionally.
23
+ */
24
+ export declare function resolveTheme(theme: CoarScriptEditorTheme): string;
25
+ /**
26
+ * Sets up observers that fire `onChange` whenever the effective auto-theme could have
27
+ * changed: media-query updates (OS dark-mode toggle), `<html>` / `<body>` class changes
28
+ * (app-level theme switchers), or `data-theme` attribute changes. Returns a cleanup
29
+ * function that removes all listeners.
30
+ *
31
+ * Consumers who pass `theme="light"` or `theme="dark"` explicitly don't need this — their
32
+ * theme is static. Only wire it up while `auto` is active.
33
+ */
34
+ export declare function watchAutoTheme(onChange: () => void): () => void;
35
+ //# sourceMappingURL=theme.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"theme.d.ts","sourceRoot":"","sources":["../src/theme.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,MAAM,eAAe,CAAC;AAE7C,eAAO,MAAM,gBAAgB,eAAe,CAAC;AAC7C,eAAO,MAAM,eAAe,cAAc,CAAC;AAI3C;;GAEG;AACH,wBAAgB,gBAAgB,CAAC,QAAQ,EAAE,OAAO,MAAM,GAAG,IAAI,CAwC9D;AAED,MAAM,MAAM,qBAAqB,GAAG,MAAM,GAAG,OAAO,GAAG,MAAM,CAAC;AAE9D;;;;;;;;GAQG;AACH,wBAAgB,eAAe,IAAI,MAAM,CA4BxC;AAED;;;;GAIG;AACH,wBAAgB,YAAY,CAAC,KAAK,EAAE,qBAAqB,GAAG,MAAM,CAIjE;AAED;;;;;;;;GAQG;AACH,wBAAgB,cAAc,CAAC,QAAQ,EAAE,MAAM,IAAI,GAAG,MAAM,IAAI,CAmB/D"}
package/package.json ADDED
@@ -0,0 +1,50 @@
1
+ {
2
+ "name": "@cocoar/vue-script-editor",
3
+ "version": "1.9.0-script-editor.4",
4
+ "description": "Monaco-based script editor component for Vue 3 with Cocoar Design System styling",
5
+ "license": "Apache-2.0",
6
+ "repository": {
7
+ "type": "git",
8
+ "url": "https://github.com/cocoar-dev/cocoar-ui-vue.git",
9
+ "directory": "packages/script-editor"
10
+ },
11
+ "homepage": "https://docs.cocoar.dev/cocoar-ui-vue/",
12
+ "bugs": "https://github.com/cocoar-dev/cocoar-ui-vue/issues",
13
+ "keywords": [
14
+ "vue",
15
+ "vue3",
16
+ "monaco",
17
+ "editor",
18
+ "typescript",
19
+ "javascript"
20
+ ],
21
+ "type": "module",
22
+ "sideEffects": [
23
+ "*.css"
24
+ ],
25
+ "main": "./dist/index.js",
26
+ "module": "./dist/index.js",
27
+ "types": "./dist/index.d.ts",
28
+ "exports": {
29
+ ".": {
30
+ "import": "./dist/index.js",
31
+ "types": "./dist/index.d.ts"
32
+ }
33
+ },
34
+ "files": [
35
+ "dist"
36
+ ],
37
+ "scripts": {
38
+ "build": "vite build",
39
+ "test": "vitest run",
40
+ "lint": "eslint src/"
41
+ },
42
+ "peerDependencies": {
43
+ "monaco-editor": "^0.54.0",
44
+ "vue": "^3.5.0"
45
+ },
46
+ "devDependencies": {
47
+ "monaco-editor": "^0.54.0",
48
+ "vue": "^3.5.32"
49
+ }
50
+ }