@pairdraw/vue 0.20.0 → 0.21.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/canvas/CanvasRoot.vue.js +3 -0
- package/dist/canvas/CanvasRoot.vue.js.map +1 -1
- package/dist/canvas/surface/color-space.d.ts +1 -0
- package/dist/canvas/surface/color-space.d.ts.map +1 -1
- package/dist/canvas/surface/gl-surface.js +16 -2
- package/dist/canvas/surface/gl-surface.js.map +1 -1
- package/dist/canvas/surface/lifecycle.js +4 -2
- package/dist/canvas/surface/lifecycle.js.map +1 -1
- package/dist/canvas/surface/origin.js +14 -0
- package/dist/canvas/surface/origin.js.map +1 -0
- package/dist/canvas/surface/shader/plan.js +40 -0
- package/dist/canvas/surface/shader/plan.js.map +1 -0
- package/dist/canvas/surface/shader/playback.js +132 -36
- package/dist/canvas/surface/shader/playback.js.map +1 -1
- package/dist/canvas/surface/shader/stage.d.ts.map +1 -1
- package/dist/canvas/surface/shader/stage.js +42 -5
- package/dist/canvas/surface/shader/stage.js.map +1 -1
- package/dist/canvas/surface/types.d.ts +16 -0
- package/dist/canvas/surface/types.d.ts.map +1 -1
- package/dist/canvas/surface/use.js +3 -1
- package/dist/canvas/surface/use.js.map +1 -1
- package/dist/canvas/useCanvasInput.d.ts +8 -8
- package/dist/controls/binding-provider/pairdraw.js +1 -1
- package/dist/controls/binding-provider/pairdraw.js.map +1 -1
- package/dist/controls/color-model/types.d.ts +6 -0
- package/dist/controls/color-model/types.d.ts.map +1 -1
- package/dist/controls/color-model/use.d.ts.map +1 -1
- package/dist/controls/color-model/use.js +5 -3
- package/dist/controls/color-model/use.js.map +1 -1
- package/dist/controls/document-colors/index.d.ts +2 -2
- package/dist/controls/document-colors/index.js +2 -2
- package/dist/controls/document-colors/use.d.ts +7 -1
- package/dist/controls/document-colors/use.d.ts.map +1 -1
- package/dist/controls/document-colors/use.js +9 -1
- package/dist/controls/document-colors/use.js.map +1 -1
- package/dist/controls/node-props/use.d.ts +3 -3
- package/dist/controls/okhcl/use.d.ts +2 -2
- package/dist/controls/shader/catalog.d.ts +11 -0
- package/dist/controls/shader/catalog.d.ts.map +1 -1
- package/dist/controls/shader/catalog.js +35 -6
- package/dist/controls/shader/catalog.js.map +1 -1
- package/dist/controls/shader/gallery.d.ts +1 -1
- package/dist/controls/shader/gallery.d.ts.map +1 -1
- package/dist/controls/shader/gallery.js +292 -0
- package/dist/controls/shader/gallery.js.map +1 -1
- package/dist/controls/shader/index.d.ts +3 -1
- package/dist/controls/shader/index.js +3 -1
- package/dist/controls/shader/shapes.d.ts +18 -0
- package/dist/controls/shader/shapes.d.ts.map +1 -0
- package/dist/controls/shader/shapes.js +227 -0
- package/dist/controls/shader/shapes.js.map +1 -0
- package/dist/controls/shader/stops.d.ts +22 -0
- package/dist/controls/shader/stops.d.ts.map +1 -0
- package/dist/controls/shader/stops.js +73 -0
- package/dist/controls/shader/stops.js.map +1 -0
- package/dist/controls/variable-modes/helpers.d.ts.map +1 -1
- package/dist/controls/variable-modes/helpers.js +4 -2
- package/dist/controls/variable-modes/helpers.js.map +1 -1
- package/dist/editor/commands/shortcut.d.ts.map +1 -1
- package/dist/editor/commands/shortcut.js +9 -1
- package/dist/editor/commands/shortcut.js.map +1 -1
- package/dist/i18n/create.d.ts +1 -1
- package/dist/i18n/create.d.ts.map +1 -1
- package/dist/i18n/create.js +1 -0
- package/dist/i18n/create.js.map +1 -1
- package/dist/i18n/locale.d.ts +5 -4
- package/dist/i18n/locale.d.ts.map +1 -1
- package/dist/i18n/locale.js +4 -0
- package/dist/i18n/locale.js.map +1 -1
- package/dist/i18n/locales/de/ai.json.js +15 -0
- package/dist/i18n/locales/de/code.json.js +2 -0
- package/dist/i18n/locales/de/comments.json.js +1 -1
- package/dist/i18n/locales/de/panels.json.js +16 -1
- package/dist/i18n/locales/es/ai.json.js +15 -0
- package/dist/i18n/locales/es/code.json.js +2 -0
- package/dist/i18n/locales/es/comments.json.js +1 -1
- package/dist/i18n/locales/es/panels.json.js +16 -1
- package/dist/i18n/locales/fr/ai.json.js +15 -0
- package/dist/i18n/locales/fr/code.json.js +2 -0
- package/dist/i18n/locales/fr/comments.json.js +1 -1
- package/dist/i18n/locales/fr/panels.json.js +16 -1
- package/dist/i18n/locales/id/agents.json.js +31 -0
- package/dist/i18n/locales/id/agents.json.js.map +1 -0
- package/dist/i18n/locales/id/ai.json.js +608 -0
- package/dist/i18n/locales/id/ai.json.js.map +1 -0
- package/dist/i18n/locales/id/automation.json.js +150 -0
- package/dist/i18n/locales/id/automation.json.js.map +1 -0
- package/dist/i18n/locales/id/browser.json.js +50 -0
- package/dist/i18n/locales/id/browser.json.js.map +1 -0
- package/dist/i18n/locales/id/chat-context.json.js +62 -0
- package/dist/i18n/locales/id/chat-context.json.js.map +1 -0
- package/dist/i18n/locales/id/cloud/editor.json.js +337 -0
- package/dist/i18n/locales/id/cloud/editor.json.js.map +1 -0
- package/dist/i18n/locales/id/cloud/portal.json.js +435 -0
- package/dist/i18n/locales/id/cloud/portal.json.js.map +1 -0
- package/dist/i18n/locales/id/code.json.js +45 -0
- package/dist/i18n/locales/id/code.json.js.map +1 -0
- package/dist/i18n/locales/id/collaboration.json.js +84 -0
- package/dist/i18n/locales/id/collaboration.json.js.map +1 -0
- package/dist/i18n/locales/id/commands.json.js +111 -0
- package/dist/i18n/locales/id/commands.json.js.map +1 -0
- package/dist/i18n/locales/id/comments.json.js +37 -0
- package/dist/i18n/locales/id/comments.json.js.map +1 -0
- package/dist/i18n/locales/id/common.json.js +51 -0
- package/dist/i18n/locales/id/common.json.js.map +1 -0
- package/dist/i18n/locales/id/credentials.json.js +21 -0
- package/dist/i18n/locales/id/credentials.json.js.map +1 -0
- package/dist/i18n/locales/id/design-check.json.js +101 -0
- package/dist/i18n/locales/id/design-check.json.js.map +1 -0
- package/dist/i18n/locales/id/design-memory.json.js +61 -0
- package/dist/i18n/locales/id/design-memory.json.js.map +1 -0
- package/dist/i18n/locales/id/diagnostics.json.js +78 -0
- package/dist/i18n/locales/id/diagnostics.json.js.map +1 -0
- package/dist/i18n/locales/id/editor.json.js +62 -0
- package/dist/i18n/locales/id/editor.json.js.map +1 -0
- package/dist/i18n/locales/id/explore.json.js +30 -0
- package/dist/i18n/locales/id/explore.json.js.map +1 -0
- package/dist/i18n/locales/id/figjam.json.js +39 -0
- package/dist/i18n/locales/id/figjam.json.js.map +1 -0
- package/dist/i18n/locales/id/files.json.js +86 -0
- package/dist/i18n/locales/id/files.json.js.map +1 -0
- package/dist/i18n/locales/id/fonts.json.js +54 -0
- package/dist/i18n/locales/id/fonts.json.js.map +1 -0
- package/dist/i18n/locales/id/index.js +85 -0
- package/dist/i18n/locales/id/index.js.map +1 -0
- package/dist/i18n/locales/id/media.json.js +52 -0
- package/dist/i18n/locales/id/media.json.js.map +1 -0
- package/dist/i18n/locales/id/menu.json.js +118 -0
- package/dist/i18n/locales/id/menu.json.js.map +1 -0
- package/dist/i18n/locales/id/pages.json.js +16 -0
- package/dist/i18n/locales/id/pages.json.js.map +1 -0
- package/dist/i18n/locales/id/panels.json.js +838 -0
- package/dist/i18n/locales/id/panels.json.js.map +1 -0
- package/dist/i18n/locales/id/recovery.json.js +36 -0
- package/dist/i18n/locales/id/recovery.json.js.map +1 -0
- package/dist/i18n/locales/id/rename.json.js +19 -0
- package/dist/i18n/locales/id/rename.json.js.map +1 -0
- package/dist/i18n/locales/id/rendering.json.js +18 -0
- package/dist/i18n/locales/id/rendering.json.js.map +1 -0
- package/dist/i18n/locales/id/settings.json.js +169 -0
- package/dist/i18n/locales/id/settings.json.js.map +1 -0
- package/dist/i18n/locales/id/shaders.json.js +24 -0
- package/dist/i18n/locales/id/shaders.json.js.map +1 -0
- package/dist/i18n/locales/id/shapes.json.js +48 -0
- package/dist/i18n/locales/id/shapes.json.js.map +1 -0
- package/dist/i18n/locales/id/slides.json.js +27 -0
- package/dist/i18n/locales/id/slides.json.js.map +1 -0
- package/dist/i18n/locales/id/statuses.json.js +38 -0
- package/dist/i18n/locales/id/statuses.json.js.map +1 -0
- package/dist/i18n/locales/id/storage.json.js +21 -0
- package/dist/i18n/locales/id/storage.json.js.map +1 -0
- package/dist/i18n/locales/id/tools.json.js +27 -0
- package/dist/i18n/locales/id/tools.json.js.map +1 -0
- package/dist/i18n/locales/id/updates.json.js +31 -0
- package/dist/i18n/locales/id/updates.json.js.map +1 -0
- package/dist/i18n/locales/id/variables/panel.json.js +175 -0
- package/dist/i18n/locales/id/variables/panel.json.js.map +1 -0
- package/dist/i18n/locales/id/variables/types.json.js +15 -0
- package/dist/i18n/locales/id/variables/types.json.js.map +1 -0
- package/dist/i18n/locales/id/variations.json.js +23 -0
- package/dist/i18n/locales/id/variations.json.js.map +1 -0
- package/dist/i18n/locales/it/ai.json.js +15 -0
- package/dist/i18n/locales/it/code.json.js +2 -0
- package/dist/i18n/locales/it/comments.json.js +1 -1
- package/dist/i18n/locales/it/panels.json.js +16 -1
- package/dist/i18n/locales/ja/ai.json.js +15 -0
- package/dist/i18n/locales/ja/code.json.js +2 -0
- package/dist/i18n/locales/ja/comments.json.js +1 -1
- package/dist/i18n/locales/ja/panels.json.js +16 -1
- package/dist/i18n/locales/pl/ai.json.js +15 -0
- package/dist/i18n/locales/pl/code.json.js +2 -0
- package/dist/i18n/locales/pl/comments.json.js +1 -1
- package/dist/i18n/locales/pl/panels.json.js +16 -1
- package/dist/i18n/locales/ru/ai.json.js +15 -0
- package/dist/i18n/locales/ru/code.json.js +2 -0
- package/dist/i18n/locales/ru/comments.json.js +1 -1
- package/dist/i18n/locales/ru/panels.json.js +16 -1
- package/dist/i18n/locales/zh-cn/ai.json.js +15 -0
- package/dist/i18n/locales/zh-cn/code.json.js +2 -0
- package/dist/i18n/locales/zh-cn/comments.json.js +1 -1
- package/dist/i18n/locales/zh-cn/panels.json.js +16 -1
- package/dist/i18n/messages/ai.d.ts +33 -0
- package/dist/i18n/messages/ai.d.ts.map +1 -1
- package/dist/i18n/messages/ai.js +17 -0
- package/dist/i18n/messages/ai.js.map +1 -1
- package/dist/i18n/messages/code.d.ts +4 -0
- package/dist/i18n/messages/code.d.ts.map +1 -1
- package/dist/i18n/messages/code.js +3 -1
- package/dist/i18n/messages/code.js.map +1 -1
- package/dist/i18n/messages/comments.d.ts +2 -2
- package/dist/i18n/messages/comments.js +2 -2
- package/dist/i18n/messages/comments.js.map +1 -1
- package/dist/i18n/messages/panels.d.ts +17 -0
- package/dist/i18n/messages/panels.d.ts.map +1 -1
- package/dist/i18n/messages/panels.js +15 -0
- package/dist/i18n/messages/panels.js.map +1 -1
- package/dist/i18n/messages.d.ts +53 -1
- package/dist/i18n/useI18n.d.ts +212 -4
- package/dist/i18n/useI18n.d.ts.map +1 -1
- package/dist/primitives/ColorPicker/ColorInputRoot.vue.d.ts +6 -0
- package/dist/primitives/ColorPicker/ColorInputRoot.vue.d.ts.map +1 -1
- package/dist/primitives/ColorPicker/ColorInputRoot.vue.js +3 -1
- package/dist/primitives/ColorPicker/ColorInputRoot.vue.js.map +1 -1
- package/dist/primitives/ColorPicker/ColorPickerRoot.vue.d.ts +6 -0
- package/dist/primitives/ColorPicker/ColorPickerRoot.vue.d.ts.map +1 -1
- package/dist/primitives/ColorPicker/ColorPickerRoot.vue.js +3 -2
- package/dist/primitives/ColorPicker/ColorPickerRoot.vue.js.map +1 -1
- package/dist/primitives/Fill/FillRoot.vue.d.ts +2 -1
- package/dist/primitives/Fill/FillRoot.vue.d.ts.map +1 -1
- package/dist/primitives/Fill/FillRoot.vue.js +5 -2
- package/dist/primitives/Fill/FillRoot.vue.js.map +1 -1
- package/dist/primitives/Fill/FillSwatch.vue.d.ts.map +1 -1
- package/dist/primitives/Fill/FillSwatch.vue.js +2 -1
- package/dist/primitives/Fill/FillSwatch.vue.js.map +1 -1
- package/dist/primitives/Fill/types.d.ts +6 -1
- package/dist/primitives/Fill/types.d.ts.map +1 -1
- package/dist/primitives/Fill/useFill.d.ts +10 -4
- package/dist/primitives/Fill/useFill.d.ts.map +1 -1
- package/dist/primitives/Fill/useFill.js +14 -10
- package/dist/primitives/Fill/useFill.js.map +1 -1
- package/dist/primitives/GradientEditor/GradientEditorRoot.vue.d.ts +2 -1
- package/dist/primitives/GradientEditor/GradientEditorRoot.vue.d.ts.map +1 -1
- package/dist/primitives/GradientEditor/GradientEditorRoot.vue.js +5 -2
- package/dist/primitives/GradientEditor/GradientEditorRoot.vue.js.map +1 -1
- package/dist/primitives/GradientEditor/GradientEditorStop.vue.d.ts.map +1 -1
- package/dist/primitives/GradientEditor/GradientEditorStop.vue.js +4 -3
- package/dist/primitives/GradientEditor/GradientEditorStop.vue.js.map +1 -1
- package/dist/primitives/GradientEditor/types.d.ts +3 -1
- package/dist/primitives/GradientEditor/types.d.ts.map +1 -1
- package/dist/primitives/GradientEditor/useGradientStops.d.ts +5 -3
- package/dist/primitives/GradientEditor/useGradientStops.d.ts.map +1 -1
- package/dist/primitives/GradientEditor/useGradientStops.js +9 -4
- package/dist/primitives/GradientEditor/useGradientStops.js.map +1 -1
- package/dist/primitives/LayerTree/LayerTreeRoot.vue.d.ts +6 -1
- package/dist/primitives/LayerTree/LayerTreeRoot.vue.d.ts.map +1 -1
- package/dist/primitives/LayerTree/LayerTreeRoot.vue.js +16 -1
- package/dist/primitives/LayerTree/LayerTreeRoot.vue.js.map +1 -1
- package/package.json +4 -4
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { useDocumentColors } from "./use.js";
|
|
2
|
-
export { useDocumentColors };
|
|
1
|
+
import { useDocumentColorSpace, useDocumentColors } from "./use.js";
|
|
2
|
+
export { useDocumentColorSpace, useDocumentColors };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { useDocumentColors } from "./use.js";
|
|
2
|
-
export { useDocumentColors };
|
|
1
|
+
import { useDocumentColorSpace, useDocumentColors } from "./use.js";
|
|
2
|
+
export { useDocumentColorSpace, useDocumentColors };
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { ComputedRef } from "vue";
|
|
2
2
|
import { DocumentColor } from "@pairdraw/core";
|
|
3
|
+
import { DocumentColorSpace } from "@pairdraw/scene-graph";
|
|
3
4
|
//#region src/controls/document-colors/use.d.ts
|
|
4
5
|
/**
|
|
5
6
|
* The solid colours the active page uses, most used first.
|
|
@@ -9,6 +10,11 @@ import { DocumentColor } from "@pairdraw/core";
|
|
|
9
10
|
* the list is empty.
|
|
10
11
|
*/
|
|
11
12
|
declare function useDocumentColors(): ComputedRef<DocumentColor[]>;
|
|
13
|
+
/**
|
|
14
|
+
* The profile the document stores its colors in, so a preview can draw the color the canvas draws.
|
|
15
|
+
* Follows the injected editor's document and falls back to sRGB outside an editor subtree.
|
|
16
|
+
*/
|
|
17
|
+
declare function useDocumentColorSpace(): ComputedRef<DocumentColorSpace>;
|
|
12
18
|
//#endregion
|
|
13
|
-
export { useDocumentColors };
|
|
19
|
+
export { useDocumentColorSpace, useDocumentColors };
|
|
14
20
|
//# sourceMappingURL=use.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"use.d.ts","names":[],"sources":["../../../src/controls/document-colors/use.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"use.d.ts","names":[],"sources":["../../../src/controls/document-colors/use.ts"],"mappings":";;;;;;;;;;;iBAegB,qBAAqB,YAAY;;;;;iBAajC,yBAAyB,YAAY"}
|
|
@@ -17,11 +17,19 @@ function useDocumentColors() {
|
|
|
17
17
|
return documentColors(editor.graph, editor.state.currentPageId);
|
|
18
18
|
});
|
|
19
19
|
}
|
|
20
|
+
/**
|
|
21
|
+
* The profile the document stores its colors in, so a preview can draw the color the canvas draws.
|
|
22
|
+
* Follows the injected editor's document and falls back to sRGB outside an editor subtree.
|
|
23
|
+
*/
|
|
24
|
+
function useDocumentColorSpace() {
|
|
25
|
+
const editor = injectEditor();
|
|
26
|
+
return computed(() => editor?.graph.documentColorSpace ?? "srgb");
|
|
27
|
+
}
|
|
20
28
|
/** The injected editor, or null when the holder is not an editor subtree. */
|
|
21
29
|
function injectEditor() {
|
|
22
30
|
return inject(EDITOR_KEY, null) ?? null;
|
|
23
31
|
}
|
|
24
32
|
//#endregion
|
|
25
|
-
export { useDocumentColors };
|
|
33
|
+
export { useDocumentColorSpace, useDocumentColors };
|
|
26
34
|
|
|
27
35
|
//# sourceMappingURL=use.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"use.js","names":[],"sources":["../../../src/controls/document-colors/use.ts"],"sourcesContent":["import { computed, inject } from 'vue'\nimport type { ComputedRef } from 'vue'\n\nimport { documentColors, type DocumentColor, type Editor } from '@pairdraw/core'\n\nimport { EDITOR_KEY } from '#vue/editor/context'\n\n/**\n * The solid colours the active page uses, most used first.\n *\n * Recomputed only when the scene or page changes (the dependency on `sceneVersion`), so an open\n * picker walks the tree once, not on every render. Outside an editor, such as a preference picker,\n * the list is empty.\n */\nexport function useDocumentColors(): ComputedRef<DocumentColor[]> {\n const editor = injectEditor()\n return computed(() => {\n if (!editor) return []\n void editor.state.sceneVersion\n return documentColors(editor.graph, editor.state.currentPageId)\n })\n}\n\n/** The injected editor, or null when the holder is not an editor subtree. */\nfunction injectEditor(): Editor | null {\n const editor = inject(EDITOR_KEY, null)\n return editor ?? null\n}\n"],"mappings":";;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"use.js","names":[],"sources":["../../../src/controls/document-colors/use.ts"],"sourcesContent":["import { computed, inject } from 'vue'\nimport type { ComputedRef } from 'vue'\n\nimport { documentColors, type DocumentColor, type Editor } from '@pairdraw/core'\nimport type { DocumentColorSpace } from '@pairdraw/scene-graph'\n\nimport { EDITOR_KEY } from '#vue/editor/context'\n\n/**\n * The solid colours the active page uses, most used first.\n *\n * Recomputed only when the scene or page changes (the dependency on `sceneVersion`), so an open\n * picker walks the tree once, not on every render. Outside an editor, such as a preference picker,\n * the list is empty.\n */\nexport function useDocumentColors(): ComputedRef<DocumentColor[]> {\n const editor = injectEditor()\n return computed(() => {\n if (!editor) return []\n void editor.state.sceneVersion\n return documentColors(editor.graph, editor.state.currentPageId)\n })\n}\n\n/**\n * The profile the document stores its colors in, so a preview can draw the color the canvas draws.\n * Follows the injected editor's document and falls back to sRGB outside an editor subtree.\n */\nexport function useDocumentColorSpace(): ComputedRef<DocumentColorSpace> {\n const editor = injectEditor()\n return computed(() => editor?.graph.documentColorSpace ?? 'srgb')\n}\n\n/** The injected editor, or null when the holder is not an editor subtree. */\nfunction injectEditor(): Editor | null {\n const editor = inject(EDITOR_KEY, null)\n return editor ?? null\n}\n"],"mappings":";;;;;;;;;;;AAeA,SAAgB,oBAAkD;CAChE,MAAM,SAAS,aAAa;CAC5B,OAAO,eAAe;EACpB,IAAI,CAAC,QAAQ,OAAO,CAAC;EACrB,OAAY,MAAM;EAClB,OAAO,eAAe,OAAO,OAAO,OAAO,MAAM,aAAa;CAChE,CAAC;AACH;;;;;AAMA,SAAgB,wBAAyD;CACvE,MAAM,SAAS,aAAa;CAC5B,OAAO,eAAe,QAAQ,MAAM,sBAAsB,MAAM;AAClE;;AAGA,SAAS,eAA8B;CAErC,OADe,OAAO,YAAY,IACtB,KAAK;AACnB"}
|
|
@@ -17,9 +17,9 @@ declare function useNodeProps(): {
|
|
|
17
17
|
prop: <K extends keyof import("@pairdraw/scene-graph").SceneNode>(key: K) => import("vue").ComputedRef<MixedValue<import("@pairdraw/scene-graph").SceneNode[K]>>;
|
|
18
18
|
merged: <K extends keyof import("@pairdraw/scene-graph").SceneNode>(key: K) => MixedValue<import("@pairdraw/scene-graph").SceneNode[K]>;
|
|
19
19
|
updateAllWithUndo: (patch: Partial<import("@pairdraw/scene-graph").SceneNode>, label: string) => void;
|
|
20
|
-
updateArrayItem: (key: "
|
|
21
|
-
removeArrayItem: (key: "
|
|
22
|
-
toggleArrayVisibility: (key: "
|
|
20
|
+
updateArrayItem: (key: "strokes" | "fills" | "effects", index: number, patch: Record<string, unknown> | import("@pairdraw/scene-graph").Fill | import("@pairdraw/scene-graph").Stroke, label: string) => void;
|
|
21
|
+
removeArrayItem: (key: "strokes" | "fills" | "effects", index: number, label: string) => void;
|
|
22
|
+
toggleArrayVisibility: (key: "strokes" | "fills" | "effects", index: number) => void;
|
|
23
23
|
isArrayMixed: (key: Parameters<typeof isNodeArrayMixed>[1]) => boolean;
|
|
24
24
|
updateProp: (key: string, value: number | string) => void;
|
|
25
25
|
commitProp: (key: string, _value: number | string, previous: number | string) => void;
|
|
@@ -5,11 +5,11 @@ declare function useOkHCL(): {
|
|
|
5
5
|
getFillOkHCLColor: typeof getFillOkHCLColor;
|
|
6
6
|
getStrokeOkHCLColor: typeof getStrokeOkHCLColor;
|
|
7
7
|
getFillPreviewInfo: (node: import("@pairdraw/scene-graph").SceneNode | null, index: number) => {
|
|
8
|
-
previewColorSpace: import("@pairdraw/scene-graph").
|
|
8
|
+
previewColorSpace: import("@pairdraw/scene-graph").ColorProfile;
|
|
9
9
|
clipped: boolean;
|
|
10
10
|
};
|
|
11
11
|
getStrokePreviewInfo: (node: import("@pairdraw/scene-graph").SceneNode | null, index: number) => {
|
|
12
|
-
previewColorSpace: import("@pairdraw/scene-graph").
|
|
12
|
+
previewColorSpace: import("@pairdraw/scene-graph").ColorProfile;
|
|
13
13
|
clipped: boolean;
|
|
14
14
|
};
|
|
15
15
|
getFieldFormat: (node: import("@pairdraw/scene-graph").SceneNode | null, index: number, kind: "fill" | "stroke") => ColorFieldFormat;
|
|
@@ -25,6 +25,15 @@ type ShaderPropControl = {
|
|
|
25
25
|
} | {
|
|
26
26
|
kind: 'text';
|
|
27
27
|
} |
|
|
28
|
+
/** Gradient stops, edited as a list of colour and position. */
|
|
29
|
+
{
|
|
30
|
+
kind: 'stops';
|
|
31
|
+
} |
|
|
32
|
+
/** The shape an effect draws on, chosen by type and kept in its JSON. */
|
|
33
|
+
{
|
|
34
|
+
kind: 'shape';
|
|
35
|
+
options: string[];
|
|
36
|
+
} |
|
|
28
37
|
/** Gradient stops, shapes, uploads, and the like, edited in the preset's JSON. */
|
|
29
38
|
{
|
|
30
39
|
kind: 'other';
|
|
@@ -36,6 +45,8 @@ interface ShaderEffect {
|
|
|
36
45
|
description: string;
|
|
37
46
|
/** Whether it changes what is drawn beneath it, such as a blur, rather than drawing its own. */
|
|
38
47
|
filter: boolean;
|
|
48
|
+
/** Whether it draws a new picture as time passes, so a preset of it may need a player. */
|
|
49
|
+
animated: boolean;
|
|
39
50
|
props: ShaderPropControl[];
|
|
40
51
|
}
|
|
41
52
|
/** An effect's name in words, `FilmGrain` as Film grain, as the properties panel names effects. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"catalog.d.ts","names":[],"sources":["../../../src/controls/shader/catalog.ts"],"mappings":";;
|
|
1
|
+
{"version":3,"file":"catalog.d.ts","names":[],"sources":["../../../src/controls/shader/catalog.ts"],"mappings":";;KAKY;EAAsB;EAAa;EAAe;EAAe;;EACvE;EAAe;EAAa;EAAa;;EACzC;;EACA;EAAgB;IAAW;IAAe;;;EAC1C;;EACA;;EACA;;;;EAEA;;;;EAEA;EAAe;;;;EAEf;;;UAIW;EACf;EACA;EACA;;EAEA;;EAEA;EACA,OAAO;;;iBA4HO,kBAAkB;;;;;iBAYlB,qBAAqB,QAAQ"}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { SHADER_SHAPES } from "./shapes.js";
|
|
1
2
|
import * as v from "valibot";
|
|
2
3
|
//#region src/controls/shader/catalog.ts
|
|
3
4
|
const labelSchema = v.optional(v.string());
|
|
@@ -24,6 +25,16 @@ const plainUISchema = v.object({
|
|
|
24
25
|
label: labelSchema,
|
|
25
26
|
group: v.optional(v.string())
|
|
26
27
|
});
|
|
28
|
+
const stopsUISchema = v.object({
|
|
29
|
+
type: uiTypes("gradient-stops"),
|
|
30
|
+
label: labelSchema,
|
|
31
|
+
group: v.optional(v.string())
|
|
32
|
+
});
|
|
33
|
+
const shapeUISchema = v.object({
|
|
34
|
+
type: uiTypes("shape"),
|
|
35
|
+
label: labelSchema,
|
|
36
|
+
group: v.optional(v.string())
|
|
37
|
+
});
|
|
27
38
|
const propMetadataSchema = v.object({
|
|
28
39
|
ui: v.optional(v.unknown()),
|
|
29
40
|
default: v.optional(v.unknown())
|
|
@@ -62,6 +73,21 @@ function control(key, metadata) {
|
|
|
62
73
|
options
|
|
63
74
|
};
|
|
64
75
|
}
|
|
76
|
+
const shape = v.safeParse(shapeUISchema, ui);
|
|
77
|
+
if (shape.success) return {
|
|
78
|
+
...base,
|
|
79
|
+
label: shape.output.label ?? words(key),
|
|
80
|
+
group: shape.output.group ?? "",
|
|
81
|
+
kind: "shape",
|
|
82
|
+
options: [...SHADER_SHAPES]
|
|
83
|
+
};
|
|
84
|
+
const stops = v.safeParse(stopsUISchema, ui);
|
|
85
|
+
if (stops.success) return {
|
|
86
|
+
...base,
|
|
87
|
+
label: stops.output.label ?? words(key),
|
|
88
|
+
group: stops.output.group ?? "",
|
|
89
|
+
kind: "stops"
|
|
90
|
+
};
|
|
65
91
|
const plain = v.safeParse(plainUISchema, ui);
|
|
66
92
|
if (plain.success) {
|
|
67
93
|
const [type] = [plain.output.type].flat();
|
|
@@ -85,7 +111,8 @@ const registryEntrySchema = v.object({
|
|
|
85
111
|
category: v.string(),
|
|
86
112
|
description: v.optional(v.string()),
|
|
87
113
|
requiresChild: v.optional(v.boolean()),
|
|
88
|
-
propsMetadata: v.optional(v.record(v.string(), v.unknown()))
|
|
114
|
+
propsMetadata: v.optional(v.record(v.string(), v.unknown())),
|
|
115
|
+
definition: v.optional(v.object({ animatedTime: v.optional(v.unknown()) }))
|
|
89
116
|
});
|
|
90
117
|
/** An effect's name in words, `FilmGrain` as Film grain, as the properties panel names effects. */
|
|
91
118
|
function shaderEffectLabel(name) {
|
|
@@ -100,16 +127,18 @@ function loadShaderCatalog() {
|
|
|
100
127
|
catalog ??= import("shaders/registry").then(({ getAllShaders }) => getAllShaders().flatMap((entry) => {
|
|
101
128
|
const parsed = v.safeParse(registryEntrySchema, entry);
|
|
102
129
|
if (!parsed.success) return [];
|
|
103
|
-
const { name, category, description = "", requiresChild = false, propsMetadata = {} } = parsed.output;
|
|
130
|
+
const { name, category, description = "", requiresChild = false, propsMetadata = {}, definition } = parsed.output;
|
|
131
|
+
const props = Object.entries(propsMetadata).flatMap(([key, metadata]) => {
|
|
132
|
+
const item = control(key, metadata);
|
|
133
|
+
return item ? [item] : [];
|
|
134
|
+
});
|
|
104
135
|
return [{
|
|
105
136
|
name,
|
|
106
137
|
category,
|
|
107
138
|
description,
|
|
108
139
|
filter: requiresChild,
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
return item ? [item] : [];
|
|
112
|
-
})
|
|
140
|
+
animated: definition?.animatedTime !== void 0,
|
|
141
|
+
props
|
|
113
142
|
}];
|
|
114
143
|
}));
|
|
115
144
|
return catalog;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"catalog.js","names":[],"sources":["../../../src/controls/shader/catalog.ts"],"sourcesContent":["import * as v from 'valibot'\n\n/** A prop of an effect, as the `shaders` library's controls describe it. */\nexport type ShaderPropControl = { key: string; label: string; group: string; default: unknown } & (\n | { kind: 'range'; min: number; max: number; step: number }\n | { kind: 'color' }\n | { kind: 'select'; options: { label: string; value: string | number }[] }\n | { kind: 'checkbox' }\n | { kind: 'position' }\n | { kind: 'text' }\n /** Gradient stops, shapes, uploads, and the like, edited in the preset's JSON. */\n | { kind: 'other' }\n)\n\n/** An effect the `shaders` library draws, with the controls of its props. */\nexport interface ShaderEffect {\n name: string\n category: string\n description: string\n /** Whether it changes what is drawn beneath it, such as a blur, rather than drawing its own. */\n filter: boolean\n props: ShaderPropControl[]\n}\n\nconst labelSchema = v.optional(v.string())\nconst uiTypes = (...types: string[]) =>\n v.union([\n v.picklist(types),\n v.pipe(\n v.array(v.string()),\n v.check((list) => types.includes(list[0] ?? ''))\n )\n ])\n\nconst rangeUISchema = v.object({\n type: uiTypes('range'),\n min: v.number(),\n max: v.number(),\n step: v.optional(v.number()),\n label: labelSchema,\n group: v.optional(v.string())\n})\nconst selectUISchema = v.object({\n type: uiTypes('select'),\n options: v.array(v.object({ label: v.string(), value: v.union([v.string(), v.number()]) })),\n label: labelSchema,\n group: v.optional(v.string())\n})\nconst plainUISchema = v.object({\n type: uiTypes('color', 'checkbox', 'position', 'origin', 'text'),\n label: labelSchema,\n group: v.optional(v.string())\n})\nconst propMetadataSchema = v.object({\n ui: v.optional(v.unknown()),\n default: v.optional(v.unknown())\n})\n\n/** Words a camel-cased prop name is made of, for a prop without a label. */\nconst words = (key: string) =>\n key.replace(/([a-z0-9])([A-Z])/g, '$1 $2').replace(/^./, (c) => c.toUpperCase())\n\nfunction control(key: string, metadata: unknown): ShaderPropControl | null {\n const parsed = v.safeParse(propMetadataSchema, metadata)\n if (!parsed.success) return null\n const { ui } = parsed.output\n const base = { key, default: parsed.output.default }\n const range = v.safeParse(rangeUISchema, ui)\n if (range.success) {\n const { min, max, step = (max - min) / 100 } = range.output\n return {\n ...base,\n label: range.output.label ?? words(key),\n group: range.output.group ?? '',\n kind: 'range',\n min,\n max,\n step\n }\n }\n const select = v.safeParse(selectUISchema, ui)\n if (select.success) {\n const { options } = select.output\n return {\n ...base,\n label: select.output.label ?? words(key),\n group: select.output.group ?? '',\n kind: 'select',\n options\n }\n }\n const plain = v.safeParse(plainUISchema, ui)\n if (plain.success) {\n const [type] = [plain.output.type].flat()\n const kind =\n type === 'origin' ? 'position' : (type as 'color' | 'checkbox' | 'position' | 'text')\n return {\n ...base,\n label: plain.output.label ?? words(key),\n group: plain.output.group ?? '',\n kind\n }\n }\n return { ...base, label: words(key), group: '', kind: 'other' }\n}\n\nconst registryEntrySchema = v.object({\n name: v.string(),\n category: v.string(),\n description: v.optional(v.string()),\n requiresChild: v.optional(v.boolean()),\n propsMetadata: v.optional(v.record(v.string(), v.unknown()))\n})\n\n/** An effect's name in words, `FilmGrain` as Film grain, as the properties panel names effects. */\nexport function shaderEffectLabel(name: string): string {\n return name\n .replace(/([a-z0-9])([A-Z])/g, '$1 $2')\n .replace(/ ([A-Z])(?=[a-z])/g, (_, letter: string) => ` ${letter.toLowerCase()}`)\n}\n\nlet catalog: Promise<ShaderEffect[]> | null = null\n\n/**\n * Every effect the `shaders` library draws, by name. The registry is large, so it is loaded\n * the first time a picker asks for it and kept for the session.\n */\nexport function loadShaderCatalog(): Promise<ShaderEffect[]> {\n catalog ??= import('shaders/registry').then(({ getAllShaders }) =>\n getAllShaders().flatMap((entry) => {\n const parsed = v.safeParse(registryEntrySchema, entry)\n if (!parsed.success) return []\n const {\n name,\n category,\n description = '',\n requiresChild = false,\n propsMetadata = {}\n } = parsed.output\n const props = Object.entries(propsMetadata).flatMap(([key, metadata]) => {\n const item = control(key, metadata)\n return item ? [item] : []\n })\n return [{
|
|
1
|
+
{"version":3,"file":"catalog.js","names":[],"sources":["../../../src/controls/shader/catalog.ts"],"sourcesContent":["import * as v from 'valibot'\n\nimport { SHADER_SHAPES } from './shapes'\n\n/** A prop of an effect, as the `shaders` library's controls describe it. */\nexport type ShaderPropControl = { key: string; label: string; group: string; default: unknown } & (\n | { kind: 'range'; min: number; max: number; step: number }\n | { kind: 'color' }\n | { kind: 'select'; options: { label: string; value: string | number }[] }\n | { kind: 'checkbox' }\n | { kind: 'position' }\n | { kind: 'text' }\n /** Gradient stops, edited as a list of colour and position. */\n | { kind: 'stops' }\n /** The shape an effect draws on, chosen by type and kept in its JSON. */\n | { kind: 'shape'; options: string[] }\n /** Gradient stops, shapes, uploads, and the like, edited in the preset's JSON. */\n | { kind: 'other' }\n)\n\n/** An effect the `shaders` library draws, with the controls of its props. */\nexport interface ShaderEffect {\n name: string\n category: string\n description: string\n /** Whether it changes what is drawn beneath it, such as a blur, rather than drawing its own. */\n filter: boolean\n /** Whether it draws a new picture as time passes, so a preset of it may need a player. */\n animated: boolean\n props: ShaderPropControl[]\n}\n\nconst labelSchema = v.optional(v.string())\nconst uiTypes = (...types: string[]) =>\n v.union([\n v.picklist(types),\n v.pipe(\n v.array(v.string()),\n v.check((list) => types.includes(list[0] ?? ''))\n )\n ])\n\nconst rangeUISchema = v.object({\n type: uiTypes('range'),\n min: v.number(),\n max: v.number(),\n step: v.optional(v.number()),\n label: labelSchema,\n group: v.optional(v.string())\n})\nconst selectUISchema = v.object({\n type: uiTypes('select'),\n options: v.array(v.object({ label: v.string(), value: v.union([v.string(), v.number()]) })),\n label: labelSchema,\n group: v.optional(v.string())\n})\nconst plainUISchema = v.object({\n type: uiTypes('color', 'checkbox', 'position', 'origin', 'text'),\n label: labelSchema,\n group: v.optional(v.string())\n})\nconst stopsUISchema = v.object({\n type: uiTypes('gradient-stops'),\n label: labelSchema,\n group: v.optional(v.string())\n})\nconst shapeUISchema = v.object({\n type: uiTypes('shape'),\n label: labelSchema,\n group: v.optional(v.string())\n})\nconst propMetadataSchema = v.object({\n ui: v.optional(v.unknown()),\n default: v.optional(v.unknown())\n})\n\n/** Words a camel-cased prop name is made of, for a prop without a label. */\nconst words = (key: string) =>\n key.replace(/([a-z0-9])([A-Z])/g, '$1 $2').replace(/^./, (c) => c.toUpperCase())\n\nfunction control(key: string, metadata: unknown): ShaderPropControl | null {\n const parsed = v.safeParse(propMetadataSchema, metadata)\n if (!parsed.success) return null\n const { ui } = parsed.output\n const base = { key, default: parsed.output.default }\n const range = v.safeParse(rangeUISchema, ui)\n if (range.success) {\n const { min, max, step = (max - min) / 100 } = range.output\n return {\n ...base,\n label: range.output.label ?? words(key),\n group: range.output.group ?? '',\n kind: 'range',\n min,\n max,\n step\n }\n }\n const select = v.safeParse(selectUISchema, ui)\n if (select.success) {\n const { options } = select.output\n return {\n ...base,\n label: select.output.label ?? words(key),\n group: select.output.group ?? '',\n kind: 'select',\n options\n }\n }\n const shape = v.safeParse(shapeUISchema, ui)\n if (shape.success) {\n return {\n ...base,\n label: shape.output.label ?? words(key),\n group: shape.output.group ?? '',\n kind: 'shape',\n options: [...SHADER_SHAPES]\n }\n }\n const stops = v.safeParse(stopsUISchema, ui)\n if (stops.success) {\n return {\n ...base,\n label: stops.output.label ?? words(key),\n group: stops.output.group ?? '',\n kind: 'stops'\n }\n }\n const plain = v.safeParse(plainUISchema, ui)\n if (plain.success) {\n const [type] = [plain.output.type].flat()\n const kind =\n type === 'origin' ? 'position' : (type as 'color' | 'checkbox' | 'position' | 'text')\n return {\n ...base,\n label: plain.output.label ?? words(key),\n group: plain.output.group ?? '',\n kind\n }\n }\n return { ...base, label: words(key), group: '', kind: 'other' }\n}\n\nconst registryEntrySchema = v.object({\n name: v.string(),\n category: v.string(),\n description: v.optional(v.string()),\n requiresChild: v.optional(v.boolean()),\n propsMetadata: v.optional(v.record(v.string(), v.unknown())),\n definition: v.optional(v.object({ animatedTime: v.optional(v.unknown()) }))\n})\n\n/** An effect's name in words, `FilmGrain` as Film grain, as the properties panel names effects. */\nexport function shaderEffectLabel(name: string): string {\n return name\n .replace(/([a-z0-9])([A-Z])/g, '$1 $2')\n .replace(/ ([A-Z])(?=[a-z])/g, (_, letter: string) => ` ${letter.toLowerCase()}`)\n}\n\nlet catalog: Promise<ShaderEffect[]> | null = null\n\n/**\n * Every effect the `shaders` library draws, by name. The registry is large, so it is loaded\n * the first time a picker asks for it and kept for the session.\n */\nexport function loadShaderCatalog(): Promise<ShaderEffect[]> {\n catalog ??= import('shaders/registry').then(({ getAllShaders }) =>\n getAllShaders().flatMap((entry) => {\n const parsed = v.safeParse(registryEntrySchema, entry)\n if (!parsed.success) return []\n const {\n name,\n category,\n description = '',\n requiresChild = false,\n propsMetadata = {},\n definition\n } = parsed.output\n const props = Object.entries(propsMetadata).flatMap(([key, metadata]) => {\n const item = control(key, metadata)\n return item ? [item] : []\n })\n return [\n {\n name,\n category,\n description,\n filter: requiresChild,\n animated: definition?.animatedTime !== undefined,\n props\n }\n ]\n })\n )\n return catalog\n}\n"],"mappings":";;;AAgCA,MAAM,cAAc,EAAE,SAAS,EAAE,OAAO,CAAC;AACzC,MAAM,WAAW,GAAG,UAClB,EAAE,MAAM,CACN,EAAE,SAAS,KAAK,GAChB,EAAE,KACA,EAAE,MAAM,EAAE,OAAO,CAAC,GAClB,EAAE,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AAO;AACT"}
|
|
@@ -7,7 +7,7 @@ import { ShaderPreset } from "@pairdraw/scene-graph/shaders";
|
|
|
7
7
|
* cannot draw shaders still shows each one's palette.
|
|
8
8
|
*/
|
|
9
9
|
/** The shaders the gallery offers, by the name the app translates. */
|
|
10
|
-
type ShaderGalleryId = 'sunset' | 'northernLights' | 'retroScreen' | 'halftonePrint' | 'ditheredDusk' | 'glassOrb' | 'marble' | 'neonGrid' | 'velvet';
|
|
10
|
+
type ShaderGalleryId = 'sunset' | 'northernLights' | 'retroScreen' | 'halftonePrint' | 'ditheredDusk' | 'glassOrb' | 'marble' | 'neonGrid' | 'velvet' | 'liquidChrome' | 'flutedGlass' | 'paperStock' | 'godRays' | 'thermal' | 'voronoiCells' | 'deepWater' | 'smokePlume' | 'neonPulse' | 'grainWash' | 'obsidian' | 'marbleInk';
|
|
11
11
|
interface ShaderGalleryEntry {
|
|
12
12
|
id: ShaderGalleryId;
|
|
13
13
|
preset: ShaderPreset;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"gallery.d.ts","names":[],"sources":["../../../src/controls/shader/gallery.ts"],"mappings":";;;;;;;;;KAYY;
|
|
1
|
+
{"version":3,"file":"gallery.d.ts","names":[],"sources":["../../../src/controls/shader/gallery.ts"],"mappings":";;;;;;;;;KAYY;UAuBK;EACf,IAAI;EACJ,QAAQ;;;cAIG,yBAAyB;;iBAqZtB,qBAAqB,QAAQ,eAAe;;;;;iBAiB5C,mBAAmB,QAAQ,cAAc"}
|
|
@@ -201,6 +201,298 @@ const SHADER_GALLERY = [
|
|
|
201
201
|
props: { strength: .2 }
|
|
202
202
|
}
|
|
203
203
|
] }
|
|
204
|
+
},
|
|
205
|
+
{
|
|
206
|
+
id: "liquidChrome",
|
|
207
|
+
preset: { components: [{
|
|
208
|
+
type: "LiquidMetal",
|
|
209
|
+
props: {
|
|
210
|
+
lightColor: "#f5f7fa",
|
|
211
|
+
darkColor: "#1c1f26",
|
|
212
|
+
turbulence: .55,
|
|
213
|
+
ripple: 1.2,
|
|
214
|
+
sharpness: .8,
|
|
215
|
+
dispersion: .25,
|
|
216
|
+
speed: .35
|
|
217
|
+
}
|
|
218
|
+
}, {
|
|
219
|
+
type: "FilmGrain",
|
|
220
|
+
props: {
|
|
221
|
+
strength: .08,
|
|
222
|
+
bias: .04
|
|
223
|
+
}
|
|
224
|
+
}] }
|
|
225
|
+
},
|
|
226
|
+
{
|
|
227
|
+
id: "flutedGlass",
|
|
228
|
+
preset: { components: [{
|
|
229
|
+
type: "FlowingGradient",
|
|
230
|
+
props: {
|
|
231
|
+
colorA: "#0f1b2d",
|
|
232
|
+
colorB: "#1f4b6e",
|
|
233
|
+
colorC: "#8fd3ff",
|
|
234
|
+
colorD: "#f5f9ff",
|
|
235
|
+
distortion: .7,
|
|
236
|
+
speed: .2
|
|
237
|
+
}
|
|
238
|
+
}, {
|
|
239
|
+
type: "FlutedGlass",
|
|
240
|
+
props: {
|
|
241
|
+
frequency: 18,
|
|
242
|
+
refraction: .6,
|
|
243
|
+
aberration: .3,
|
|
244
|
+
highlight: .5,
|
|
245
|
+
edges: "mirror",
|
|
246
|
+
speed: .2
|
|
247
|
+
}
|
|
248
|
+
}] }
|
|
249
|
+
},
|
|
250
|
+
{
|
|
251
|
+
id: "paperStock",
|
|
252
|
+
preset: { components: [{
|
|
253
|
+
type: "FlowingGradient",
|
|
254
|
+
props: {
|
|
255
|
+
colorA: "#efe7d8",
|
|
256
|
+
colorB: "#e2d6c2",
|
|
257
|
+
distortion: .2,
|
|
258
|
+
speed: 0
|
|
259
|
+
}
|
|
260
|
+
}, {
|
|
261
|
+
type: "Paper",
|
|
262
|
+
props: {
|
|
263
|
+
roughness: .65,
|
|
264
|
+
grainScale: .8,
|
|
265
|
+
displacement: .25,
|
|
266
|
+
seed: 7
|
|
267
|
+
}
|
|
268
|
+
}] }
|
|
269
|
+
},
|
|
270
|
+
{
|
|
271
|
+
id: "godRays",
|
|
272
|
+
preset: { components: [{
|
|
273
|
+
type: "Godrays",
|
|
274
|
+
props: {
|
|
275
|
+
rayColor: "#ffe9b0",
|
|
276
|
+
backgroundColor: "#0b0a12",
|
|
277
|
+
density: .7,
|
|
278
|
+
intensity: .9,
|
|
279
|
+
spotty: .3,
|
|
280
|
+
speed: .15
|
|
281
|
+
}
|
|
282
|
+
}, {
|
|
283
|
+
type: "FilmGrain",
|
|
284
|
+
props: { strength: .12 }
|
|
285
|
+
}] }
|
|
286
|
+
},
|
|
287
|
+
{
|
|
288
|
+
id: "thermal",
|
|
289
|
+
preset: { components: [{
|
|
290
|
+
type: "Heatmap",
|
|
291
|
+
props: {
|
|
292
|
+
colorA: "#08131f",
|
|
293
|
+
colorB: "#f7f3cf",
|
|
294
|
+
stops: [
|
|
295
|
+
{
|
|
296
|
+
color: "#08131f",
|
|
297
|
+
position: 0
|
|
298
|
+
},
|
|
299
|
+
{
|
|
300
|
+
color: "#1d6fb8",
|
|
301
|
+
position: .3
|
|
302
|
+
},
|
|
303
|
+
{
|
|
304
|
+
color: "#f2d21a",
|
|
305
|
+
position: .55
|
|
306
|
+
},
|
|
307
|
+
{
|
|
308
|
+
color: "#f08a24",
|
|
309
|
+
position: .78
|
|
310
|
+
},
|
|
311
|
+
{
|
|
312
|
+
color: "#e0212f",
|
|
313
|
+
position: 1
|
|
314
|
+
}
|
|
315
|
+
],
|
|
316
|
+
innerGlow: .6,
|
|
317
|
+
outerGlow: .4,
|
|
318
|
+
contour: .2,
|
|
319
|
+
speed: .3
|
|
320
|
+
}
|
|
321
|
+
}, {
|
|
322
|
+
type: "FilmGrain",
|
|
323
|
+
props: { strength: .06 }
|
|
324
|
+
}] }
|
|
325
|
+
},
|
|
326
|
+
{
|
|
327
|
+
id: "voronoiCells",
|
|
328
|
+
preset: { components: [{
|
|
329
|
+
type: "Voronoi",
|
|
330
|
+
props: {
|
|
331
|
+
colorA: "#101820",
|
|
332
|
+
colorB: "#3fb6a8",
|
|
333
|
+
colorBorder: "#e8fff9",
|
|
334
|
+
scale: 9,
|
|
335
|
+
edgeIntensity: .7,
|
|
336
|
+
edgeSoftness: .15,
|
|
337
|
+
seed: 21,
|
|
338
|
+
speed: .1
|
|
339
|
+
}
|
|
340
|
+
}, {
|
|
341
|
+
type: "FilmGrain",
|
|
342
|
+
props: { strength: .08 }
|
|
343
|
+
}] }
|
|
344
|
+
},
|
|
345
|
+
{
|
|
346
|
+
id: "deepWater",
|
|
347
|
+
preset: { components: [
|
|
348
|
+
{
|
|
349
|
+
type: "Water",
|
|
350
|
+
props: {
|
|
351
|
+
waterColor: "#0a2a43",
|
|
352
|
+
clarity: .55,
|
|
353
|
+
depth: .8,
|
|
354
|
+
shallows: .35,
|
|
355
|
+
caustics: .6,
|
|
356
|
+
causticScale: 2.4,
|
|
357
|
+
choppiness: .35,
|
|
358
|
+
waveScale: 1.2,
|
|
359
|
+
reflection: .4,
|
|
360
|
+
foam: .15,
|
|
361
|
+
speed: .25
|
|
362
|
+
}
|
|
363
|
+
},
|
|
364
|
+
{
|
|
365
|
+
type: "LightLeak",
|
|
366
|
+
props: {
|
|
367
|
+
colorHot: "#9fe2ff",
|
|
368
|
+
colorMid: "#1f4b6e",
|
|
369
|
+
intensity: .25,
|
|
370
|
+
spread: .6,
|
|
371
|
+
speed: .15
|
|
372
|
+
}
|
|
373
|
+
},
|
|
374
|
+
{
|
|
375
|
+
type: "FilmGrain",
|
|
376
|
+
props: { strength: .06 }
|
|
377
|
+
}
|
|
378
|
+
] }
|
|
379
|
+
},
|
|
380
|
+
{
|
|
381
|
+
id: "smokePlume",
|
|
382
|
+
preset: { components: [{
|
|
383
|
+
type: "SmokeFill",
|
|
384
|
+
props: {
|
|
385
|
+
colorA: "#ffffff",
|
|
386
|
+
colorB: "#6d6a75",
|
|
387
|
+
direction: 90,
|
|
388
|
+
speed: .25,
|
|
389
|
+
spread: .5,
|
|
390
|
+
emitRadius: .2,
|
|
391
|
+
intensity: .8,
|
|
392
|
+
dissipation: .55,
|
|
393
|
+
detail: .6,
|
|
394
|
+
gravity: .05,
|
|
395
|
+
colorDecay: .4
|
|
396
|
+
}
|
|
397
|
+
}, {
|
|
398
|
+
type: "FilmGrain",
|
|
399
|
+
props: { strength: .05 }
|
|
400
|
+
}] }
|
|
401
|
+
},
|
|
402
|
+
{
|
|
403
|
+
id: "neonPulse",
|
|
404
|
+
preset: { components: [{
|
|
405
|
+
type: "LightEdge",
|
|
406
|
+
props: {
|
|
407
|
+
colorA: "#ff2fb3",
|
|
408
|
+
colorB: "#22d3ee",
|
|
409
|
+
stops: [{
|
|
410
|
+
color: "#ff2fb3",
|
|
411
|
+
position: 0
|
|
412
|
+
}, {
|
|
413
|
+
color: "#22d3ee",
|
|
414
|
+
position: 1
|
|
415
|
+
}],
|
|
416
|
+
thickness: .35,
|
|
417
|
+
softness: .5,
|
|
418
|
+
intensity: .9,
|
|
419
|
+
bloom: .7,
|
|
420
|
+
spots: 3,
|
|
421
|
+
pulse: .6,
|
|
422
|
+
smoke: .2,
|
|
423
|
+
speed: .5
|
|
424
|
+
}
|
|
425
|
+
}, {
|
|
426
|
+
type: "FilmGrain",
|
|
427
|
+
props: { strength: .06 }
|
|
428
|
+
}] }
|
|
429
|
+
},
|
|
430
|
+
{
|
|
431
|
+
id: "grainWash",
|
|
432
|
+
preset: { components: [{
|
|
433
|
+
type: "FlowingGradient",
|
|
434
|
+
props: {
|
|
435
|
+
colorA: "#0b1026",
|
|
436
|
+
colorB: "#243b80",
|
|
437
|
+
colorC: "#7c5cff",
|
|
438
|
+
colorD: "#ffb86b",
|
|
439
|
+
distortion: .7,
|
|
440
|
+
speed: .25
|
|
441
|
+
}
|
|
442
|
+
}, {
|
|
443
|
+
type: "FilmGrain",
|
|
444
|
+
props: {
|
|
445
|
+
strength: .18,
|
|
446
|
+
bias: .05
|
|
447
|
+
}
|
|
448
|
+
}] }
|
|
449
|
+
},
|
|
450
|
+
{
|
|
451
|
+
id: "obsidian",
|
|
452
|
+
preset: { components: [{
|
|
453
|
+
type: "Obsidian",
|
|
454
|
+
props: {
|
|
455
|
+
bodyColor: "#0a0b0f",
|
|
456
|
+
colorA: "#3b0f52",
|
|
457
|
+
colorB: "#0f6b6b",
|
|
458
|
+
iridescence: .5,
|
|
459
|
+
rimWidth: .25,
|
|
460
|
+
rimSoftness: .3,
|
|
461
|
+
flowScale: 1.6,
|
|
462
|
+
gloss: .7,
|
|
463
|
+
bevelWidth: .2,
|
|
464
|
+
speed: .2
|
|
465
|
+
}
|
|
466
|
+
}, {
|
|
467
|
+
type: "FilmGrain",
|
|
468
|
+
props: { strength: .06 }
|
|
469
|
+
}] }
|
|
470
|
+
},
|
|
471
|
+
{
|
|
472
|
+
id: "marbleInk",
|
|
473
|
+
preset: { components: [{
|
|
474
|
+
type: "Marble",
|
|
475
|
+
props: {
|
|
476
|
+
colorA: "#f7f4ee",
|
|
477
|
+
colorB: "#20232b",
|
|
478
|
+
colorC: "#8a8f9a",
|
|
479
|
+
turbulence: 8,
|
|
480
|
+
scale: 1.4,
|
|
481
|
+
speed: .05
|
|
482
|
+
}
|
|
483
|
+
}, {
|
|
484
|
+
type: "Halftone",
|
|
485
|
+
props: {
|
|
486
|
+
style: "cmyk",
|
|
487
|
+
frequency: 70,
|
|
488
|
+
paperColor: "#f7f4ee",
|
|
489
|
+
cyanColor: "#00a6c9",
|
|
490
|
+
magentaColor: "#e0218a",
|
|
491
|
+
yellowColor: "#f2d21a",
|
|
492
|
+
blackColor: "#111111",
|
|
493
|
+
misprint: .005
|
|
494
|
+
}
|
|
495
|
+
}] }
|
|
204
496
|
}
|
|
205
497
|
];
|
|
206
498
|
/** The gallery shader `preset` is, unchanged; null once any of its effects was edited. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"gallery.js","names":[],"sources":["../../../src/controls/shader/gallery.ts"],"sourcesContent":["import { isEqual, uniq } from 'es-toolkit'\n\nimport type { ShaderPreset } from '@pairdraw/scene-graph/shaders'\n\n/**\n * Complete shaders a shader paint can start from in one click: each stacks a texture with the\n * filters and overlays that finish it, flat at the top level so the picker lists and edits every\n * effect. Colors are written out rather than left to the library's defaults, so a gallery that\n * cannot draw shaders still shows each one's palette.\n */\n\n/** The shaders the gallery offers, by the name the app translates. */\nexport type ShaderGalleryId =\n | 'sunset'\n | 'northernLights'\n | 'retroScreen'\n | 'halftonePrint'\n | 'ditheredDusk'\n | 'glassOrb'\n | 'marble'\n | 'neonGrid'\n | 'velvet'\n\nexport interface ShaderGalleryEntry {\n id: ShaderGalleryId\n preset: ShaderPreset\n}\n\n/** The gallery in the order it is shown. */\nexport const SHADER_GALLERY: readonly ShaderGalleryEntry[] = [\n {\n id: 'sunset',\n preset: {\n components: [\n {\n type: 'MeshGradient',\n props: {\n stops: [\n { color: '#1b0b3a', position: 0 },\n { color: '#7b2cbf', position: 0.3 },\n { color: '#ff5b2e', position: 0.6 },\n { color: '#ff9e44', position: 0.8 },\n { color: '#ffd98e', position: 1 }\n ],\n seed: 12\n }\n },\n { type: 'FilmGrain', props: { strength: 0.2 } }\n ]\n }\n },\n {\n id: 'northernLights',\n preset: {\n components: [\n { type: 'SolidColor', props: { color: '#04101f' } },\n {\n type: 'Aurora',\n props: { colorA: '#7c3aed', colorB: '#22ee88', colorC: '#1694e8', intensity: 85 }\n },\n { type: 'FilmGrain', props: { strength: 0.15 } }\n ]\n }\n },\n {\n id: 'retroScreen',\n preset: {\n components: [\n { type: 'Plasma', props: { colorA: '#ff2e88', colorB: '#120024' } },\n { type: 'CRTScreen', props: { pixelSize: 96, scanlineIntensity: 0.45 } }\n ]\n }\n },\n {\n id: 'halftonePrint',\n preset: {\n components: [\n { type: 'Swirl', props: { colorA: '#1d4ed8', colorB: '#f97316' } },\n { type: 'Halftone', props: { style: 'cmyk', frequency: 80 } }\n ]\n }\n },\n {\n id: 'ditheredDusk',\n preset: {\n components: [\n {\n type: 'FlowingGradient',\n props: { colorA: '#0b1026', colorB: '#3b1d6e', colorC: '#ff5b2e', colorD: '#ffc46b' }\n },\n { type: 'Dither', props: { pattern: 'bayer8', pixelSize: 3, colorMode: 'source' } }\n ]\n }\n },\n {\n id: 'glassOrb',\n preset: {\n components: [\n {\n type: 'MeshGradient',\n props: {\n stops: [\n { color: '#0f172a', position: 0 },\n { color: '#2563eb', position: 0.4 },\n { color: '#22d3ee', position: 0.75 },\n { color: '#a7f3d0', position: 1 }\n ],\n seed: 4\n }\n },\n { type: 'Glass', props: { refraction: 1.2, aberration: 0.6 } }\n ]\n }\n },\n {\n id: 'marble',\n preset: {\n components: [\n { type: 'Marble', props: { colorA: '#f5f5f4', colorB: '#57534e', colorC: '#0c0a09' } },\n { type: 'Vignette', props: { intensity: 0.6 } }\n ]\n }\n },\n {\n id: 'neonGrid',\n preset: {\n components: [\n { type: 'SolidColor', props: { color: '#0a0614' } },\n { type: 'Grid', props: { color: '#ff2ea6', cells: 12, thickness: 2, softness: 0.2 } },\n { type: 'Glow', props: { intensity: 6, threshold: 0.3, size: 30 } }\n ]\n }\n },\n {\n id: 'velvet',\n preset: {\n components: [\n { type: 'Satin', props: { color: '#7f1d3a', highlightColor: '#e8798f' } },\n { type: 'LightLeak', props: { intensity: 0.25 } },\n { type: 'FilmGrain', props: { strength: 0.2 } }\n ]\n }\n }\n]\n\n/** The gallery shader `preset` is, unchanged; null once any of its effects was edited. */\nexport function shaderGalleryEntryOf(preset: ShaderPreset): ShaderGalleryEntry | null {\n return SHADER_GALLERY.find((entry) => isEqual(entry.preset, preset)) ?? null\n}\n\nconst HEX_COLOR = /^#(?:[\\da-f]{3,4}|[\\da-f]{6}|[\\da-f]{8})$/i\n\nfunction colorsIn(value: unknown): string[] {\n if (typeof value === 'string') return HEX_COLOR.test(value) ? [value.toLowerCase()] : []\n if (Array.isArray(value)) return value.flatMap(colorsIn)\n if (typeof value === 'object' && value !== null) return Object.values(value).flatMap(colorsIn)\n return []\n}\n\n/**\n * The colors `preset` sets, in the order its effects draw, without repeats and at most `limit` of\n * them: a palette that stands in for the shader where it cannot be drawn.\n */\nexport function shaderPresetColors(preset: ShaderPreset, limit = 4): string[] {\n const colors = preset.components.flatMap((component) => colorsIn(component.props))\n return uniq(colors).slice(0, limit)\n}\n"],"mappings":";;;AA6BA,MAAa,iBAAgD;CAC3D;EACE,IAAI;EACJ,QAAQ,EACN,YAAY,CACV;GACE,MAAM;GACN,OAAO;IACL,OAAO;KACL;MAAE,OAAO;MAAW,UAAU;KAAE;KAChC;MAAE,OAAO;MAAW,UAAU;KAAI;KAClC;MAAE,OAAO;MAAW,UAAU;KAAI;KAClC;MAAE,OAAO;MAAW,UAAU;KAAI;KAClC;MAAE,OAAO;MAAW,UAAU;KAAE;IAClC;IACA,MAAM;GACR;EACF,GACA;GAAE,MAAM;GAAa,OAAO,EAAE,UAAU,GAAI;EAAE,CAChD,EACF;CACF;CACA;EACE,IAAI;EACJ,QAAQ,EACN,YAAY;GACV;IAAE,MAAM;IAAc,OAAO,EAAE,OAAO,UAAU;GAAE;GAClD;IACE,MAAM;IACN,OAAO;KAAE,QAAQ;KAAW,QAAQ;KAAW,QAAQ;KAAW,WAAW;IAAG;GAClF;GACA;IAAE,MAAM;IAAa,OAAO,EAAE,UAAU,IAAK;GAAE;EACjD,EACF;CACF;CACA;EACE,IAAI;EACJ,QAAQ,EACN,YAAY,CACV;GAAE,MAAM;GAAU,OAAO;IAAE,QAAQ;IAAW,QAAQ;GAAU;EAAE,GAClE;GAAE,MAAM;GAAa,OAAO;IAAE,WAAW;IAAI,mBAAmB;GAAK;EAAE,CACzE,EACF;CACF;CACA;EACE,IAAI;EACJ,QAAQ,EACN,YAAY,CACV;GAAE,MAAM;GAAS,OAAO;IAAE,QAAQ;IAAW,QAAQ;GAAU;EAAE,GACjE;GAAE,MAAM;GAAY,OAAO;IAAE,OAAO;IAAQ,WAAW;GAAG;EAAE,CAC9D,EACF;CACF;CACA;EACE,IAAI;EACJ,QAAQ,EACN,YAAY,CACV;GACE,MAAM;GACN,OAAO;IAAE,QAAQ;IAAW,QAAQ;IAAW,QAAQ;IAAW,QAAQ;GAAU;EACtF,GACA;GAA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AM,YAAY;AAElB,SAAS,SAAS,OAA0B;CAC1C,IAAI,OAAO,UAAU,UAAU,OAAO,UAAU,KAAK,KAAK,IAAI,CAAC,MAAM,YAAY,CAAC,IAAI,CAAC;CACvF,IAAI,MAAM,QAAQ,KAAK,GAAG,OAAO,MAAM,QAAQ,QAAQ;CACvD,IAAI,OAAO,UAAU,YAAY,UAAU,MAAM,OAAO,OAAO,OAAO,KAAK,CAAC,CAAC,QAAQ,QAAQ;CAC7F,OAAO,CAAC;AACV;;;;;AAMA,SAAgB,mBAAmB,QAAsB,QAAQ,GAAa;CAC5E,MAAM,SAAS,OAAO,WAAW,SAAS,cAAc,SAAS,UAAU,KAAK,CAAC;CACjF,OAAO,KAAK,MAAM,CAAC,CAAC,MAAM,GAAG,KAAK;AACpC"}
|
|
1
|
+
{"version":3,"file":"gallery.js","names":[],"sources":["../../../src/controls/shader/gallery.ts"],"sourcesContent":["import { isEqual, uniq } from 'es-toolkit'\n\nimport type { ShaderPreset } from '@pairdraw/scene-graph/shaders'\n\n/**\n * Complete shaders a shader paint can start from in one click: each stacks a texture with the\n * filters and overlays that finish it, flat at the top level so the picker lists and edits every\n * effect. Colors are written out rather than left to the library's defaults, so a gallery that\n * cannot draw shaders still shows each one's palette.\n */\n\n/** The shaders the gallery offers, by the name the app translates. */\nexport type ShaderGalleryId =\n | 'sunset'\n | 'northernLights'\n | 'retroScreen'\n | 'halftonePrint'\n | 'ditheredDusk'\n | 'glassOrb'\n | 'marble'\n | 'neonGrid'\n | 'velvet'\n | 'liquidChrome'\n | 'flutedGlass'\n | 'paperStock'\n | 'godRays'\n | 'thermal'\n | 'voronoiCells'\n | 'deepWater'\n | 'smokePlume'\n | 'neonPulse'\n | 'grainWash'\n | 'obsidian'\n | 'marbleInk'\n\nexport interface ShaderGalleryEntry {\n id: ShaderGalleryId\n preset: ShaderPreset\n}\n\n/** The gallery in the order it is shown. */\nexport const SHADER_GALLERY: readonly ShaderGalleryEntry[] = [\n {\n id: 'sunset',\n preset: {\n components: [\n {\n type: 'MeshGradient',\n props: {\n stops: [\n { color: '#1b0b3a', position: 0 },\n { color: '#7b2cbf', position: 0.3 },\n { color: '#ff5b2e', position: 0.6 },\n { color: '#ff9e44', position: 0.8 },\n { color: '#ffd98e', position: 1 }\n ],\n seed: 12\n }\n },\n { type: 'FilmGrain', props: { strength: 0.2 } }\n ]\n }\n },\n {\n id: 'northernLights',\n preset: {\n components: [\n { type: 'SolidColor', props: { color: '#04101f' } },\n {\n type: 'Aurora',\n props: { colorA: '#7c3aed', colorB: '#22ee88', colorC: '#1694e8', intensity: 85 }\n },\n { type: 'FilmGrain', props: { strength: 0.15 } }\n ]\n }\n },\n {\n id: 'retroScreen',\n preset: {\n components: [\n { type: 'Plasma', props: { colorA: '#ff2e88', colorB: '#120024' } },\n { type: 'CRTScreen', props: { pixelSize: 96, scanlineIntensity: 0.45 } }\n ]\n }\n },\n {\n id: 'halftonePrint',\n preset: {\n components: [\n { type: 'Swirl', props: { colorA: '#1d4ed8', colorB: '#f97316' } },\n { type: 'Halftone', props: { style: 'cmyk', frequency: 80 } }\n ]\n }\n },\n {\n id: 'ditheredDusk',\n preset: {\n components: [\n {\n type: 'FlowingGradient',\n props: { colorA: '#0b1026', colorB: '#3b1d6e', colorC: '#ff5b2e', colorD: '#ffc46b' }\n },\n { type: 'Dither', props: { pattern: 'bayer8', pixelSize: 3, colorMode: 'source' } }\n ]\n }\n },\n {\n id: 'glassOrb',\n preset: {\n components: [\n {\n type: 'MeshGradient',\n props: {\n stops: [\n { color: '#0f172a', position: 0 },\n { color: '#2563eb', position: 0.4 },\n { color: '#22d3ee', position: 0.75 },\n { color: '#a7f3d0', position: 1 }\n ],\n seed: 4\n }\n },\n { type: 'Glass', props: { refraction: 1.2, aberration: 0.6 } }\n ]\n }\n },\n {\n id: 'marble',\n preset: {\n components: [\n { type: 'Marble', props: { colorA: '#f5f5f4', colorB: '#57534e', colorC: '#0c0a09' } },\n { type: 'Vignette', props: { intensity: 0.6 } }\n ]\n }\n },\n {\n id: 'neonGrid',\n preset: {\n components: [\n { type: 'SolidColor', props: { color: '#0a0614' } },\n { type: 'Grid', props: { color: '#ff2ea6', cells: 12, thickness: 2, softness: 0.2 } },\n { type: 'Glow', props: { intensity: 6, threshold: 0.3, size: 30 } }\n ]\n }\n },\n {\n id: 'velvet',\n preset: {\n components: [\n { type: 'Satin', props: { color: '#7f1d3a', highlightColor: '#e8798f' } },\n { type: 'LightLeak', props: { intensity: 0.25 } },\n { type: 'FilmGrain', props: { strength: 0.2 } }\n ]\n }\n },\n {\n id: 'liquidChrome',\n preset: {\n components: [\n {\n type: 'LiquidMetal',\n props: {\n lightColor: '#f5f7fa',\n darkColor: '#1c1f26',\n turbulence: 0.55,\n ripple: 1.2,\n sharpness: 0.8,\n dispersion: 0.25,\n speed: 0.35\n }\n },\n { type: 'FilmGrain', props: { strength: 0.08, bias: 0.04 } }\n ]\n }\n },\n {\n id: 'flutedGlass',\n preset: {\n components: [\n {\n type: 'FlowingGradient',\n props: {\n colorA: '#0f1b2d',\n colorB: '#1f4b6e',\n colorC: '#8fd3ff',\n colorD: '#f5f9ff',\n distortion: 0.7,\n speed: 0.2\n }\n },\n {\n type: 'FlutedGlass',\n props: {\n frequency: 18,\n refraction: 0.6,\n aberration: 0.3,\n highlight: 0.5,\n edges: 'mirror',\n speed: 0.2\n }\n }\n ]\n }\n },\n {\n id: 'paperStock',\n preset: {\n components: [\n {\n type: 'FlowingGradient',\n props: { colorA: '#efe7d8', colorB: '#e2d6c2', distortion: 0.2, speed: 0 }\n },\n {\n type: 'Paper',\n props: { roughness: 0.65, grainScale: 0.8, displacement: 0.25, seed: 7 }\n }\n ]\n }\n },\n {\n id: 'godRays',\n preset: {\n components: [\n {\n type: 'Godrays',\n props: {\n rayColor: '#ffe9b0',\n backgroundColor: '#0b0a12',\n density: 0.7,\n intensity: 0.9,\n spotty: 0.3,\n speed: 0.15\n }\n },\n { type: 'FilmGrain', props: { strength: 0.12 } }\n ]\n }\n },\n {\n id: 'thermal',\n preset: {\n components: [\n {\n type: 'Heatmap',\n props: {\n colorA: '#08131f',\n colorB: '#f7f3cf',\n stops: [\n { color: '#08131f', position: 0 },\n { color: '#1d6fb8', position: 0.3 },\n { color: '#f2d21a', position: 0.55 },\n { color: '#f08a24', position: 0.78 },\n { color: '#e0212f', position: 1 }\n ],\n innerGlow: 0.6,\n outerGlow: 0.4,\n contour: 0.2,\n speed: 0.3\n }\n },\n { type: 'FilmGrain', props: { strength: 0.06 } }\n ]\n }\n },\n {\n id: 'voronoiCells',\n preset: {\n components: [\n {\n type: 'Voronoi',\n props: {\n colorA: '#101820',\n colorB: '#3fb6a8',\n colorBorder: '#e8fff9',\n scale: 9,\n edgeIntensity: 0.7,\n edgeSoftness: 0.15,\n seed: 21,\n speed: 0.1\n }\n },\n { type: 'FilmGrain', props: { strength: 0.08 } }\n ]\n }\n },\n {\n id: 'deepWater',\n preset: {\n components: [\n {\n type: 'Water',\n props: {\n waterColor: '#0a2a43',\n clarity: 0.55,\n depth: 0.8,\n shallows: 0.35,\n caustics: 0.6,\n causticScale: 2.4,\n choppiness: 0.35,\n waveScale: 1.2,\n reflection: 0.4,\n foam: 0.15,\n speed: 0.25\n }\n },\n {\n type: 'LightLeak',\n props: {\n colorHot: '#9fe2ff',\n colorMid: '#1f4b6e',\n intensity: 0.25,\n spread: 0.6,\n speed: 0.15\n }\n },\n { type: 'FilmGrain', props: { strength: 0.06 } }\n ]\n }\n },\n {\n id: 'smokePlume',\n preset: {\n components: [\n {\n type: 'SmokeFill',\n props: {\n colorA: '#ffffff',\n colorB: '#6d6a75',\n direction: 90,\n speed: 0.25,\n spread: 0.5,\n emitRadius: 0.2,\n intensity: 0.8,\n dissipation: 0.55,\n detail: 0.6,\n gravity: 0.05,\n colorDecay: 0.4\n }\n },\n { type: 'FilmGrain', props: { strength: 0.05 } }\n ]\n }\n },\n {\n id: 'neonPulse',\n preset: {\n components: [\n {\n type: 'LightEdge',\n props: {\n colorA: '#ff2fb3',\n colorB: '#22d3ee',\n stops: [\n { color: '#ff2fb3', position: 0 },\n { color: '#22d3ee', position: 1 }\n ],\n thickness: 0.35,\n softness: 0.5,\n intensity: 0.9,\n bloom: 0.7,\n spots: 3,\n pulse: 0.6,\n smoke: 0.2,\n speed: 0.5\n }\n },\n { type: 'FilmGrain', props: { strength: 0.06 } }\n ]\n }\n },\n {\n id: 'grainWash',\n preset: {\n components: [\n {\n type: 'FlowingGradient',\n props: {\n colorA: '#0b1026',\n colorB: '#243b80',\n colorC: '#7c5cff',\n colorD: '#ffb86b',\n distortion: 0.7,\n speed: 0.25\n }\n },\n { type: 'FilmGrain', props: { strength: 0.18, bias: 0.05 } }\n ]\n }\n },\n {\n id: 'obsidian',\n preset: {\n components: [\n {\n type: 'Obsidian',\n props: {\n bodyColor: '#0a0b0f',\n colorA: '#3b0f52',\n colorB: '#0f6b6b',\n iridescence: 0.5,\n rimWidth: 0.25,\n rimSoftness: 0.3,\n flowScale: 1.6,\n gloss: 0.7,\n bevelWidth: 0.2,\n speed: 0.2\n }\n },\n { type: 'FilmGrain', props: { strength: 0.06 } }\n ]\n }\n },\n {\n id: 'marbleInk',\n preset: {\n components: [\n {\n type: 'Marble',\n props: {\n colorA: '#f7f4ee',\n colorB: '#20232b',\n colorC: '#8a8f9a',\n turbulence: 8,\n scale: 1.4,\n speed: 0.05\n }\n },\n {\n type: 'Halftone',\n props: {\n style: 'cmyk',\n frequency: 70,\n paperColor: '#f7f4ee',\n cyanColor: '#00a6c9',\n magentaColor: '#e0218a',\n yellowColor: '#f2d21a',\n blackColor: '#111111',\n misprint: 0.005\n }\n }\n ]\n }\n }\n]\n\n/** The gallery shader `preset` is, unchanged; null once any of its effects was edited. */\nexport function shaderGalleryEntryOf(preset: ShaderPreset): ShaderGalleryEntry | null {\n return SHADER_GALLERY.find((entry) => isEqual(entry.preset, preset)) ?? null\n}\n\nconst HEX_COLOR = /^#(?:[\\da-f]{3,4}|[\\da-f]{6}|[\\da-f]{8})$/i\n\nfunction colorsIn(value: unknown): string[] {\n if (typeof value === 'string') return HEX_COLOR.test(value) ? [value.toLowerCase()] : []\n if (Array.isArray(value)) return value.flatMap(colorsIn)\n if (typeof value === 'object' && value !== null) return Object.values(value).flatMap(colorsIn)\n return []\n}\n\n/**\n * The colors `preset` sets, in the order its effects draw, without repeats and at most `limit` of\n * them: a palette that stands in for the shader where it cannot be drawn.\n */\nexport function shaderPresetColors(preset: ShaderPreset, limit = 4): string[] {\n const colors = preset.components.flatMap((component) => colorsIn(component.props))\n return uniq(colors).slice(0, limit)\n}\n"],"mappings":";;;AAyCA,MAAa,iBAAgD;CAC3D;EACE,IAAI;EACJ,QAAQ,EACN,YAAY,CACV;GACE,MAAM;GACN,OAAO;IACL,OAAO;KACL;MAAE,OAAO;MAAW,UAAU;KAAE;KAChC;MAAE,OAAO;MAAW,UAAU;KAAI;KAClC;MAAE,OAAO;MAAW,UAAU;KAAI;KAClC;MAAE,OAAO;MAAW,UAAU;KAAI;KAClC;MAAE,OAAO;MAAW,UAAU;KAAE;IAClC;IACA,MAAM;GACR;EACF,GACA;GAAE,MAAM;GAAa,OAAO,EAAE,UAAU,GAAI;EAAE,CAChD,EACF;CACF;CACA;EACE,IAAI;EACJ,QAAQ,EACN,YAAY;GACV;IAAE,MAAM;IAAc,OAAO,EAAE,OAAO,UAAU;GAAE;GAClD;IACE,MAAM;IACN,OAAO;KAAE,QAAQ;KAAW,QAAQ;KAAW,QAAQ;KAAW,WAAW;IAAG;GAClF;GACA;IAAE,MAAM;IAAa,OAAO,EAAE,UAAU,IAAK;GAAE;EACjD,EACF;CACF;CACA;EACE,IAAI;EACJ,QAAQ,EACN,YAAY,CACV;GAAE,MAAM;GAAU,OAAO;IAAE,QAAQ;IAAW,QAAQ;GAAU;EAAE,GAClE;GAAE,MAAM;GAAa,OAAO;IAAE,WAAW;IAAI,mBAAmB;GAAK;EAAE,CACzE,EACF;CACF;CACA;EACE,IAAI;EACJ,QAAQ,EACN,YAAY,CACV;GAAE,M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AAK,IAAI,CAAC,MAAM,YAAY,CAAC,IAAI,CAAC;CACvF,IAAI,MAAM,QAAQ,KAAK,GAAG,OAAO,MAAM,QAAQ,QAAQ;CACvD,IAAI,OAAO,UAAU,YAAY,UAAU,MAAM,OAAO,OAAO,OAAO,KAAK,CAAC,CAAC,QAAQ,QAAQ;CAC7F,OAAO,CAAC;AACV;;;;;AAMA,SAAgB,mBAAmB,QAAsB,QAAQ,GAAa;CAC5E,MAAM,SAAS,OAAO,WAAW,SAAS,cAAc,SAAS,UAAU,KAAK,CAAC;CACjF,OAAO,KAAK,MAAM,CAAC,CAAC,MAAM,GAAG,KAAK;AACpC"}
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import { ShaderEffect, ShaderPropControl, loadShaderCatalog, shaderEffectLabel } from "./catalog.js";
|
|
2
2
|
import { SHADER_GALLERY, ShaderGalleryEntry, ShaderGalleryId, shaderGalleryEntryOf, shaderPresetColors } from "./gallery.js";
|
|
3
3
|
import { shaderEffectPreview, shaderGalleryPreview } from "./preview.js";
|
|
4
|
+
import { SHADER_SHAPES, ShaderShape, shaderShapeType, withShapeType } from "./shapes.js";
|
|
5
|
+
import { ShaderStop, addStop, removeStop, setStopColor, setStopPosition, shaderStops } from "./stops.js";
|
|
4
6
|
import { DEFAULT_SHADER_EFFECT, DEFAULT_SHADER_PRESET, DEFAULT_SHADER_SOURCE, addShaderEffect, moveShaderEffect, parseShaderPreset, removeShaderEffect, setShaderEffectProp, shaderPresetJSON } from "./preset.js";
|
|
5
|
-
export { DEFAULT_SHADER_EFFECT, DEFAULT_SHADER_PRESET, DEFAULT_SHADER_SOURCE, SHADER_GALLERY, type ShaderEffect, type ShaderGalleryEntry, type ShaderGalleryId, type ShaderPropControl, addShaderEffect, loadShaderCatalog, moveShaderEffect, parseShaderPreset, removeShaderEffect, setShaderEffectProp, shaderEffectLabel, shaderEffectPreview, shaderGalleryEntryOf, shaderGalleryPreview, shaderPresetColors, shaderPresetJSON };
|
|
7
|
+
export { DEFAULT_SHADER_EFFECT, DEFAULT_SHADER_PRESET, DEFAULT_SHADER_SOURCE, SHADER_GALLERY, SHADER_SHAPES, type ShaderEffect, type ShaderGalleryEntry, type ShaderGalleryId, type ShaderPropControl, type ShaderShape, type ShaderStop, addShaderEffect, addStop, loadShaderCatalog, moveShaderEffect, parseShaderPreset, removeShaderEffect, removeStop, setShaderEffectProp, setStopColor, setStopPosition, shaderEffectLabel, shaderEffectPreview, shaderGalleryEntryOf, shaderGalleryPreview, shaderPresetColors, shaderPresetJSON, shaderShapeType, shaderStops, withShapeType };
|
|
@@ -1,5 +1,7 @@
|
|
|
1
|
+
import { SHADER_SHAPES, shaderShapeType, withShapeType } from "./shapes.js";
|
|
1
2
|
import { loadShaderCatalog, shaderEffectLabel } from "./catalog.js";
|
|
2
3
|
import { SHADER_GALLERY, shaderGalleryEntryOf, shaderPresetColors } from "./gallery.js";
|
|
3
4
|
import { shaderEffectPreview, shaderGalleryPreview } from "./preview.js";
|
|
5
|
+
import { addStop, removeStop, setStopColor, setStopPosition, shaderStops } from "./stops.js";
|
|
4
6
|
import { DEFAULT_SHADER_EFFECT, DEFAULT_SHADER_PRESET, DEFAULT_SHADER_SOURCE, addShaderEffect, moveShaderEffect, parseShaderPreset, removeShaderEffect, setShaderEffectProp, shaderPresetJSON } from "./preset.js";
|
|
5
|
-
export { DEFAULT_SHADER_EFFECT, DEFAULT_SHADER_PRESET, DEFAULT_SHADER_SOURCE, SHADER_GALLERY, addShaderEffect, loadShaderCatalog, moveShaderEffect, parseShaderPreset, removeShaderEffect, setShaderEffectProp, shaderEffectLabel, shaderEffectPreview, shaderGalleryEntryOf, shaderGalleryPreview, shaderPresetColors, shaderPresetJSON };
|
|
7
|
+
export { DEFAULT_SHADER_EFFECT, DEFAULT_SHADER_PRESET, DEFAULT_SHADER_SOURCE, SHADER_GALLERY, SHADER_SHAPES, addShaderEffect, addStop, loadShaderCatalog, moveShaderEffect, parseShaderPreset, removeShaderEffect, removeStop, setShaderEffectProp, setStopColor, setStopPosition, shaderEffectLabel, shaderEffectPreview, shaderGalleryEntryOf, shaderGalleryPreview, shaderPresetColors, shaderPresetJSON, shaderShapeType, shaderStops, withShapeType };
|