@snowcone-app/canvas 0.14.0 → 0.16.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/dist/CanvasStateV1-BQD8fCBU.js +3699 -0
- package/dist/CanvasStateV1-BQD8fCBU.js.map +1 -0
- package/dist/ThemeContext-D9AaUw9v.js +1200 -0
- package/dist/ThemeContext-D9AaUw9v.js.map +1 -0
- package/dist/advanced.mjs +4 -4
- package/dist/api/embed.d.ts +14 -0
- package/dist/components/embed-realtime/RealtimeCanvas.d.ts +24 -1
- package/dist/contexts/EditorContext.d.ts +1 -0
- package/dist/embed.mjs +173 -158
- package/dist/embed.mjs.map +1 -1
- package/dist/index.mjs +47 -51
- package/dist/index.mjs.map +1 -1
- package/dist/internals.mjs +1 -1
- package/dist/rendering/PieceGuideRenderer.d.ts +2 -16
- package/dist/{template-fields-Dw-KK9DX.js → template-fields-PcSPApl5.js} +87 -82
- package/dist/template-fields-PcSPApl5.js.map +1 -0
- package/dist/testing.mjs +1 -1
- package/dist/utils/inkLuminance.d.ts +38 -0
- package/dist/{validation-BahKiJWj.js → validation-BpEod0Rn.js} +5570 -5590
- package/dist/validation-BpEod0Rn.js.map +1 -0
- package/package.json +3 -3
- package/dist/CanvasStateV1-CKsfggNP.js +0 -456
- package/dist/CanvasStateV1-CKsfggNP.js.map +0 -1
- package/dist/ThemeContext-Cl1JPVLZ.js +0 -1158
- package/dist/ThemeContext-Cl1JPVLZ.js.map +0 -1
- package/dist/schemas-B4UXytQB.js +0 -3250
- package/dist/schemas-B4UXytQB.js.map +0 -1
- package/dist/template-fields-Dw-KK9DX.js.map +0 -1
- package/dist/validation-BahKiJWj.js.map +0 -1
package/dist/testing.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsx as a } from "react/jsx-runtime";
|
|
2
2
|
import { useState as u } from "react";
|
|
3
|
-
import { T as s, E as m } from "./ThemeContext-
|
|
3
|
+
import { T as s, E as m } from "./ThemeContext-D9AaUw9v.js";
|
|
4
4
|
import { ad as d, A as h, g, I as A } from "./HybridHistoryManager-NL3zyEl4.js";
|
|
5
5
|
const x = ({
|
|
6
6
|
children: t,
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* inkLuminance - Shared colour-luminance helpers.
|
|
3
|
+
*
|
|
4
|
+
* Quick "is this ink dark / light" checks used to decide whether to
|
|
5
|
+
* flip an author-supplied colour for the current theme/background. We
|
|
6
|
+
* only need to handle hex literals (`#rgb`, `#rrggbb`) and `rgb(...)` —
|
|
7
|
+
* the formats Loom emits. CSS colour names / `hsl()` fall through to
|
|
8
|
+
* `null` ("neither"), which lets callers skip any flip — the safe
|
|
9
|
+
* choice (no surprising visual change for unfamiliar inputs).
|
|
10
|
+
*
|
|
11
|
+
* Originally lived in PieceGuideRenderer; extracted so element-creation
|
|
12
|
+
* defaults (artboard-aware ink) can reuse the same luminance math.
|
|
13
|
+
*
|
|
14
|
+
* @internal — exposed for tests; not part of the package's public
|
|
15
|
+
* API. Don't import these from outside the canvas package.
|
|
16
|
+
*
|
|
17
|
+
* @module
|
|
18
|
+
*/
|
|
19
|
+
/** @internal */
|
|
20
|
+
export declare function isInkDark(css: string): boolean;
|
|
21
|
+
/** @internal */
|
|
22
|
+
export declare function isInkLight(css: string): boolean;
|
|
23
|
+
/** @internal */
|
|
24
|
+
export declare function inkLuminance(css: string): number | null;
|
|
25
|
+
/** Default text ink for light artboard backgrounds. */
|
|
26
|
+
export declare const DEFAULT_TEXT_INK = "#333333";
|
|
27
|
+
/** Default text ink for dark artboard backgrounds. */
|
|
28
|
+
export declare const DEFAULT_TEXT_INK_ON_DARK = "#f4f4f5";
|
|
29
|
+
/**
|
|
30
|
+
* Pick the default text colour for a newly created element based on the
|
|
31
|
+
* artboard background it lands on: dark backgrounds get light ink so new
|
|
32
|
+
* text is visible; everything else (light, transparent, unknown formats)
|
|
33
|
+
* keeps the classic dark ink.
|
|
34
|
+
*
|
|
35
|
+
* Used ONLY by the element-creation default path (handleAddElement) —
|
|
36
|
+
* bindings, templates, and deserialization always honour explicit colours.
|
|
37
|
+
*/
|
|
38
|
+
export declare function defaultTextColorForBackground(backgroundColor: string | null | undefined): string;
|