@domternal/vanilla 0.8.0 → 0.9.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.ts +2 -3
- package/dist/index.js +1 -2
- package/dist/index.js.map +1 -1
- package/package.json +12 -11
- package/LICENSE +0 -21
- package/dist/bubble-menu/index.d.ts +0 -2
- package/dist/bubble-menu/index.d.ts.map +0 -1
- package/dist/editor/index.d.ts +0 -2
- package/dist/editor/index.d.ts.map +0 -1
- package/dist/emoji-picker/index.d.ts +0 -2
- package/dist/emoji-picker/index.d.ts.map +0 -1
- package/dist/floating-menu/index.d.ts +0 -2
- package/dist/floating-menu/index.d.ts.map +0 -1
- package/dist/index.d.ts.map +0 -1
- package/dist/notion-color-picker/index.d.ts +0 -2
- package/dist/notion-color-picker/index.d.ts.map +0 -1
- package/dist/shared/eventTarget.d.ts +0 -22
- package/dist/shared/eventTarget.d.ts.map +0 -1
- package/dist/shared/iconRenderer.d.ts +0 -20
- package/dist/shared/iconRenderer.d.ts.map +0 -1
- package/dist/shared/index.d.ts +0 -6
- package/dist/shared/index.d.ts.map +0 -1
- package/dist/shared/isBrowser.d.ts +0 -13
- package/dist/shared/isBrowser.d.ts.map +0 -1
- package/dist/shared/pluginKey.d.ts +0 -14
- package/dist/shared/pluginKey.d.ts.map +0 -1
- package/dist/shared/types.d.ts +0 -15
- package/dist/shared/types.d.ts.map +0 -1
- package/dist/toolbar/index.d.ts +0 -2
- package/dist/toolbar/index.d.ts.map +0 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@domternal/vanilla",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.9.1",
|
|
4
4
|
"description": "Polished DOM components for the Domternal rich-text editor. Use in Astro, Svelte, Solid, plain HTML.",
|
|
5
5
|
"author": "https://github.com/ThomasNowHere",
|
|
6
6
|
"license": "MIT",
|
|
@@ -19,8 +19,15 @@
|
|
|
19
19
|
"dist"
|
|
20
20
|
],
|
|
21
21
|
"peerDependencies": {
|
|
22
|
-
"@domternal/core": ">=0.
|
|
23
|
-
|
|
22
|
+
"@domternal/core": ">=0.9.0"
|
|
23
|
+
},
|
|
24
|
+
"scripts": {
|
|
25
|
+
"build": "tsup",
|
|
26
|
+
"dev": "tsup --watch",
|
|
27
|
+
"lint": "eslint src",
|
|
28
|
+
"typecheck": "tsc --noEmit",
|
|
29
|
+
"prepublishOnly": "pnpm build && node -e \"const p=JSON.parse(require('fs').readFileSync('package.json','utf8'));delete p.devDependencies;if(p.dependencies){for(const[k,v]of Object.entries(p.dependencies)){if(v==='workspace:*')p.dependencies[k]='>=0.9.0'}}require('fs').writeFileSync('package.json',JSON.stringify(p,null,2)+'\\n')\"",
|
|
30
|
+
"postpublish": "git checkout package.json"
|
|
24
31
|
},
|
|
25
32
|
"keywords": [
|
|
26
33
|
"vanilla",
|
|
@@ -40,11 +47,5 @@
|
|
|
40
47
|
"bugs": {
|
|
41
48
|
"url": "https://github.com/domternal/domternal/issues"
|
|
42
49
|
},
|
|
43
|
-
"homepage": "https://domternal.dev"
|
|
44
|
-
|
|
45
|
-
"build": "tsup",
|
|
46
|
-
"dev": "tsup --watch",
|
|
47
|
-
"lint": "eslint src",
|
|
48
|
-
"typecheck": "tsc --noEmit"
|
|
49
|
-
}
|
|
50
|
-
}
|
|
50
|
+
"homepage": "https://domternal.dev"
|
|
51
|
+
}
|
package/LICENSE
DELETED
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
MIT License
|
|
2
|
-
|
|
3
|
-
Copyright (c) 2026 Domternal contributors
|
|
4
|
-
|
|
5
|
-
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
-
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
-
in the Software without restriction, including without limitation the rights
|
|
8
|
-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
-
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
-
furnished to do so, subject to the following conditions:
|
|
11
|
-
|
|
12
|
-
The above copyright notice and this permission notice shall be included in all
|
|
13
|
-
copies or substantial portions of the Software.
|
|
14
|
-
|
|
15
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
-
SOFTWARE.
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/bubble-menu/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,CAAC"}
|
package/dist/editor/index.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/editor/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/emoji-picker/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/floating-menu/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,CAAC"}
|
package/dist/index.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAGH,OAAO,EAAE,SAAS,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AACjE,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AACxD,OAAO,EAAE,cAAc,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AACvE,OAAO,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAC;AACpD,YAAY,EAAE,mBAAmB,EAAE,MAAM,mBAAmB,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/notion-color-picker/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,CAAC"}
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Helpers for typed event subscription over `EventTarget`.
|
|
3
|
-
*
|
|
4
|
-
* Each `@domternal/vanilla` class extends the platform `EventTarget` and
|
|
5
|
-
* dispatches `CustomEvent` instances. Consumers can use the platform
|
|
6
|
-
* `addEventListener('eventName', handler)` directly, OR call `subscribe()`
|
|
7
|
-
* which returns an unsubscribe function and narrows the detail type.
|
|
8
|
-
*
|
|
9
|
-
* Usage:
|
|
10
|
-
* ```ts
|
|
11
|
-
* import { subscribe } from '@domternal/vanilla';
|
|
12
|
-
*
|
|
13
|
-
* const off = subscribe<{ isOpen: boolean }>(picker, 'openchange', (detail) => {
|
|
14
|
-
* console.log(detail.isOpen);
|
|
15
|
-
* });
|
|
16
|
-
* off(); // remove listener
|
|
17
|
-
* ```
|
|
18
|
-
*
|
|
19
|
-
* Each class JSDoc lists the events it emits + the shape of `detail`.
|
|
20
|
-
*/
|
|
21
|
-
export declare function subscribe<TDetail = unknown>(target: EventTarget, type: string, listener: (detail: TDetail) => void): () => void;
|
|
22
|
-
//# sourceMappingURL=eventTarget.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"eventTarget.d.ts","sourceRoot":"","sources":["../../src/shared/eventTarget.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAKH,wBAAgB,SAAS,CAAC,OAAO,GAAG,OAAO,EACzC,MAAM,EAAE,WAAW,EACnB,IAAI,EAAE,MAAM,EACZ,QAAQ,EAAE,CAAC,MAAM,EAAE,OAAO,KAAK,IAAI,GAClC,MAAM,IAAI,CAQZ"}
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import type { IconSet } from '@domternal/core';
|
|
2
|
-
/**
|
|
3
|
-
* Resolve and inject an icon's SVG string into a host element.
|
|
4
|
-
*
|
|
5
|
-
* Why innerHTML is safe here: icons come from the `defaultIcons` lookup
|
|
6
|
-
* table (Phosphor SVG strings shipped with core) or from a consumer-provided
|
|
7
|
-
* `IconSet` object. Both are trusted by contract - they are constants in
|
|
8
|
-
* source code, not user input. This matches the React (`dangerouslySetInnerHTML`),
|
|
9
|
-
* Angular (`bypassSecurityTrustHtml`), and Vue (`v-html`) patterns.
|
|
10
|
-
*
|
|
11
|
-
* Consumer responsibility (documented in README): never pass user-controlled
|
|
12
|
-
* strings as icon values in your IconSet.
|
|
13
|
-
*/
|
|
14
|
-
export declare function renderIconInto(hostEl: HTMLElement, iconKey: string | undefined, icons: IconSet | undefined): void;
|
|
15
|
-
/**
|
|
16
|
-
* Resolve an icon's SVG string without injection. Useful when caller
|
|
17
|
-
* builds the final DOM tree (e.g. via document.createElement chain).
|
|
18
|
-
*/
|
|
19
|
-
export declare function resolveIcon(iconKey: string | undefined, icons: IconSet | undefined): string;
|
|
20
|
-
//# sourceMappingURL=iconRenderer.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"iconRenderer.d.ts","sourceRoot":"","sources":["../../src/shared/iconRenderer.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,iBAAiB,CAAC;AAE/C;;;;;;;;;;;GAWG;AACH,wBAAgB,cAAc,CAC5B,MAAM,EAAE,WAAW,EACnB,OAAO,EAAE,MAAM,GAAG,SAAS,EAC3B,KAAK,EAAE,OAAO,GAAG,SAAS,GACzB,IAAI,CASN;AAED;;;GAGG;AACH,wBAAgB,WAAW,CACzB,OAAO,EAAE,MAAM,GAAG,SAAS,EAC3B,KAAK,EAAE,OAAO,GAAG,SAAS,GACzB,MAAM,CAGR"}
|
package/dist/shared/index.d.ts
DELETED
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
export { isBrowser, assertBrowser } from './isBrowser.js';
|
|
2
|
-
export { createPluginKey } from './pluginKey.js';
|
|
3
|
-
export { renderIconInto, resolveIcon } from './iconRenderer.js';
|
|
4
|
-
export { subscribe } from './eventTarget.js';
|
|
5
|
-
export type { CustomContentOption } from './types.js';
|
|
6
|
-
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/shared/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAC1D,OAAO,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAC;AACjD,OAAO,EAAE,cAAc,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAChE,OAAO,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAC7C,YAAY,EAAE,mBAAmB,EAAE,MAAM,YAAY,CAAC"}
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* SSR-safe environment check.
|
|
3
|
-
*
|
|
4
|
-
* `@domternal/vanilla` classes construct DOM nodes and attach listeners on
|
|
5
|
-
* `document` / `window`. During SSR (Astro/Nuxt/Next.js build), the module
|
|
6
|
-
* may be imported but constructors must NOT run server-side.
|
|
7
|
-
*
|
|
8
|
-
* Class constructors call `assertBrowser()` early - throws a clear error
|
|
9
|
-
* if invoked outside a browser environment.
|
|
10
|
-
*/
|
|
11
|
-
export declare const isBrowser: boolean;
|
|
12
|
-
export declare function assertBrowser(className: string): void;
|
|
13
|
-
//# sourceMappingURL=isBrowser.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"isBrowser.d.ts","sourceRoot":"","sources":["../../src/shared/isBrowser.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AACH,eAAO,MAAM,SAAS,EAAE,OAC0C,CAAC;AAEnE,wBAAgB,aAAa,CAAC,SAAS,EAAE,MAAM,GAAG,IAAI,CAQrD"}
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import { PluginKey } from '@domternal/core';
|
|
2
|
-
/**
|
|
3
|
-
* Create a unique PluginKey with collision-free suffix.
|
|
4
|
-
*
|
|
5
|
-
* Two instances of the same wrapper class mounted in the same editor (rare
|
|
6
|
-
* but supported) need distinct keys to avoid ProseMirror plugin clashes.
|
|
7
|
-
*
|
|
8
|
-
* Why crypto.randomUUID + Math.random fallback: matches the framework
|
|
9
|
-
* wrapper convention (angular, react, vue all use this pattern as of
|
|
10
|
-
* commit fbef072). SSR may share Math.random seed across mount cycles,
|
|
11
|
-
* giving collisions; crypto.randomUUID is collision-free by spec.
|
|
12
|
-
*/
|
|
13
|
-
export declare function createPluginKey(prefix: string): PluginKey;
|
|
14
|
-
//# sourceMappingURL=pluginKey.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"pluginKey.d.ts","sourceRoot":"","sources":["../../src/shared/pluginKey.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAE5C;;;;;;;;;;GAUG;AACH,wBAAgB,eAAe,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,CAKzD"}
|
package/dist/shared/types.d.ts
DELETED
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Shared option types reused across @domternal/vanilla components.
|
|
3
|
-
*/
|
|
4
|
-
/**
|
|
5
|
-
* Custom content slot - pass a pre-built DOM tree the wrapper appends
|
|
6
|
-
* into its host instead of rendering the default UI.
|
|
7
|
-
*
|
|
8
|
-
* The DOM you pass stays YOURS. The wrapper does NOT mutate it after
|
|
9
|
-
* construction and does NOT clean up event handlers on it during destroy.
|
|
10
|
-
* Manage its lifecycle yourself.
|
|
11
|
-
*/
|
|
12
|
-
export interface CustomContentOption {
|
|
13
|
-
customContent?: HTMLElement;
|
|
14
|
-
}
|
|
15
|
-
//# sourceMappingURL=types.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/shared/types.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH;;;;;;;GAOG;AACH,MAAM,WAAW,mBAAmB;IAClC,aAAa,CAAC,EAAE,WAAW,CAAC;CAC7B"}
|
package/dist/toolbar/index.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/toolbar/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,CAAC"}
|