@sealpixel/element 1.0.0-rc.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/README.md ADDED
@@ -0,0 +1,3 @@
1
+ # @sealpixel/element
2
+
3
+ `import "@sealpixel/element"` and use `<sealpixel-editor>`. Includes every first-party plugin and a worker-backed renderer.
@@ -0,0 +1,19 @@
1
+ /**
2
+ * `import '@sealpixel/element'` registers `<sealpixel-editor>` and friends with the
3
+ * first-party plugins and a worker-backed renderer. Bundlers that understand
4
+ * `new Worker(new URL(..., import.meta.url), { type: 'module' })` (Vite,
5
+ * webpack 5, esbuild with the worker plugin, Parcel) emit the worker chunk.
6
+ */
7
+ import { type AnyPlugin, type Renderer } from '@sealpixel/core';
8
+ import { allPlugins, defaultPlugins } from '@sealpixel/plugins';
9
+ import '@sealpixel/ui/define';
10
+ export * from '@sealpixel/ui';
11
+ export { allPlugins, defaultPlugins };
12
+ /**
13
+ * Starts the bundled worker when the plugin list is the default one, with or
14
+ * without options; options never reach the renderer. A custom
15
+ * plugin list needs a custom worker (see `startSealpixelWorker`), so it falls
16
+ * back to rendering inline.
17
+ */
18
+ export declare function createDefaultRenderer(plugins?: readonly AnyPlugin[]): Renderer;
19
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,OAAO,EAAE,KAAK,SAAS,EAAkB,KAAK,QAAQ,EAAkB,MAAM,iBAAiB,CAAC;AAChG,OAAO,EAAE,UAAU,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AAEhE,OAAO,sBAAsB,CAAC;AAE9B,cAAc,eAAe,CAAC;AAC9B,OAAO,EAAE,UAAU,EAAE,cAAc,EAAE,CAAC;AAEtC;;;;;GAKG;AACH,wBAAgB,qBAAqB,CAAC,OAAO,GAAE,SAAS,SAAS,EAAmB,GAAG,QAAQ,CAe9F"}
package/dist/index.js ADDED
@@ -0,0 +1,34 @@
1
+ /**
2
+ * `import '@sealpixel/element'` registers `<sealpixel-editor>` and friends with the
3
+ * first-party plugins and a worker-backed renderer. Bundlers that understand
4
+ * `new Worker(new URL(..., import.meta.url), { type: 'module' })` (Vite,
5
+ * webpack 5, esbuild with the worker plugin, Parcel) emit the worker chunk.
6
+ */
7
+ import { InlineRenderer, WorkerRenderer } from '@sealpixel/core';
8
+ import { allPlugins, defaultPlugins } from '@sealpixel/plugins';
9
+ import { SealpixelEditor } from '@sealpixel/ui';
10
+ import '@sealpixel/ui/define';
11
+ export * from '@sealpixel/ui';
12
+ export { allPlugins, defaultPlugins };
13
+ /**
14
+ * Starts the bundled worker when the plugin list is the default one, with or
15
+ * without options; options never reach the renderer. A custom
16
+ * plugin list needs a custom worker (see `startSealpixelWorker`), so it falls
17
+ * back to rendering inline.
18
+ */
19
+ export function createDefaultRenderer(plugins = defaultPlugins) {
20
+ const sameAsDefault = plugins.length === defaultPlugins.length &&
21
+ plugins.every((p, i) => p.id === defaultPlugins[i]?.id && p.version === defaultPlugins[i]?.version);
22
+ if (sameAsDefault && typeof Worker !== 'undefined') {
23
+ try {
24
+ const worker = new Worker(new URL('./worker.js', import.meta.url), { type: 'module' });
25
+ return new WorkerRenderer(worker);
26
+ }
27
+ catch {
28
+ // fall through to inline
29
+ }
30
+ }
31
+ return new InlineRenderer({ plugins, maxClientMegapixels: 16, proxyMaxSide: 2048 });
32
+ }
33
+ SealpixelEditor.defaultRendererFactory ??= createDefaultRenderer;
34
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,OAAO,EAAkB,cAAc,EAAiB,cAAc,EAAE,MAAM,iBAAiB,CAAC;AAChG,OAAO,EAAE,UAAU,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AAChE,OAAO,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;AAChD,OAAO,sBAAsB,CAAC;AAE9B,cAAc,eAAe,CAAC;AAC9B,OAAO,EAAE,UAAU,EAAE,cAAc,EAAE,CAAC;AAEtC;;;;;GAKG;AACH,MAAM,UAAU,qBAAqB,CAAC,UAAgC,cAAc;IAClF,MAAM,aAAa,GACjB,OAAO,CAAC,MAAM,KAAK,cAAc,CAAC,MAAM;QACxC,OAAO,CAAC,KAAK,CACX,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,EAAE,KAAK,cAAc,CAAC,CAAC,CAAC,EAAE,EAAE,IAAI,CAAC,CAAC,OAAO,KAAK,cAAc,CAAC,CAAC,CAAC,EAAE,OAAO,CACrF,CAAC;IACJ,IAAI,aAAa,IAAI,OAAO,MAAM,KAAK,WAAW,EAAE,CAAC;QACnD,IAAI,CAAC;YACH,MAAM,MAAM,GAAG,IAAI,MAAM,CAAC,IAAI,GAAG,CAAC,aAAa,EAAE,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,CAAC,CAAC;YACvF,OAAO,IAAI,cAAc,CAAC,MAAM,CAAC,CAAC;QACpC,CAAC;QAAC,MAAM,CAAC;YACP,yBAAyB;QAC3B,CAAC;IACH,CAAC;IACD,OAAO,IAAI,cAAc,CAAC,EAAE,OAAO,EAAE,mBAAmB,EAAE,EAAE,EAAE,YAAY,EAAE,IAAI,EAAE,CAAC,CAAC;AACtF,CAAC;AAED,eAAe,CAAC,sBAAsB,KAAK,qBAAqB,CAAC"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=worker.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"worker.d.ts","sourceRoot":"","sources":["../src/worker.ts"],"names":[],"mappings":""}
package/dist/worker.js ADDED
@@ -0,0 +1,5 @@
1
+ /** The default render worker: every first-party plugin, loaded by `@sealpixel/element`. */
2
+ import { startSealpixelWorker } from '@sealpixel/core/worker';
3
+ import { defaultPlugins } from '@sealpixel/plugins';
4
+ startSealpixelWorker({ plugins: defaultPlugins });
5
+ //# sourceMappingURL=worker.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"worker.js","sourceRoot":"","sources":["../src/worker.ts"],"names":[],"mappings":"AAAA,2FAA2F;AAC3F,OAAO,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AAC9D,OAAO,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AAEpD,oBAAoB,CAAC,EAAE,OAAO,EAAE,cAAc,EAAE,CAAC,CAAC"}
package/package.json ADDED
@@ -0,0 +1,45 @@
1
+ {
2
+ "name": "@sealpixel/element",
3
+ "version": "1.0.0-rc.0",
4
+ "description": "Drop-in <sealpixel-editor> with all first-party plugins and a bundled render worker. Import once, use the tag.",
5
+ "license": "BUSL-1.1",
6
+ "repository": {
7
+ "type": "git",
8
+ "url": "git+https://github.com/9feet/sealpixel.git",
9
+ "directory": "packages/element"
10
+ },
11
+ "homepage": "https://docs.sealpixel.dev",
12
+ "bugs": "https://github.com/9feet/sealpixel/issues",
13
+ "type": "module",
14
+ "sideEffects": true,
15
+ "files": [
16
+ "dist",
17
+ "README.md"
18
+ ],
19
+ "exports": {
20
+ ".": {
21
+ "types": "./dist/index.d.ts",
22
+ "default": "./dist/index.js"
23
+ },
24
+ "./worker": {
25
+ "types": "./dist/worker.d.ts",
26
+ "default": "./dist/worker.js"
27
+ },
28
+ "./package.json": "./package.json"
29
+ },
30
+ "scripts": {
31
+ "build": "tsc -p tsconfig.build.json",
32
+ "typecheck": "tsc -p tsconfig.json --noEmit"
33
+ },
34
+ "dependencies": {
35
+ "@sealpixel/core": "workspace:*",
36
+ "@sealpixel/plugins": "workspace:*",
37
+ "@sealpixel/ui": "workspace:*",
38
+ "@sealpixel/wasm": "workspace:*"
39
+ },
40
+ "devDependencies": {
41
+ "@sealpixel/config": "workspace:*",
42
+ "@types/node": "^24.0.0",
43
+ "typescript": "^5.9.0"
44
+ }
45
+ }