efficient-easel 0.99.1 → 0.100.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 +281 -36
- package/dist/autosave/index.d.ts +12 -6
- package/dist/blocks/index.d.ts +2 -2
- package/dist/canvas/index.d.ts +3 -3
- package/dist/canvas/index.js +1 -1
- package/dist/chrome/chrome.css +96 -29
- package/dist/chrome/index.d.ts +72 -19
- package/dist/chrome/index.js +17 -21
- package/dist/chunk-3EDSDPIP.js +1 -0
- package/dist/chunk-67GNT6PF.js +1 -0
- package/dist/{chunk-PI26YXYD.js → chunk-6EIVTKZZ.js} +21 -14
- package/dist/chunk-A5UK76FC.js +6 -0
- package/dist/chunk-AZT7V4UM.js +10 -0
- package/dist/chunk-DICUMYMG.js +12 -0
- package/dist/chunk-HDVD27VB.js +1 -0
- package/dist/chunk-JQM3V7XQ.js +1 -0
- package/dist/{chunk-TDA4HH54.js → chunk-JUQ6YJCG.js} +1 -1
- package/dist/chunk-LA54QLP5.js +1 -0
- package/dist/chunk-LGKQXSKO.js +16 -0
- package/dist/chunk-M6F6LS3H.js +1 -0
- package/dist/chunk-MH5GUZFQ.js +9 -0
- package/dist/chunk-P6O363EE.js +6 -0
- package/dist/chunk-PAELDYYS.js +1 -0
- package/dist/{chunk-JYPOOHII.js → chunk-QKVR3K73.js} +3 -3
- package/dist/chunk-SAJUCHOX.js +1 -0
- package/dist/chunk-TRVZ7C23.js +1 -0
- package/dist/chunk-V7GIIXFB.js +16 -0
- package/dist/{chunk-IBOFSS56.js → chunk-WZ7TGAAT.js} +1 -1
- package/dist/chunk-ZJEBF4NB.js +1 -0
- package/dist/copy/copy.css +388 -5
- package/dist/copy/index.d.ts +271 -8
- package/dist/copy/index.js +31 -10
- package/dist/data/index.d.ts +4 -4
- package/dist/drag/drag.css +10 -1
- package/dist/drag/index.d.ts +102 -11
- package/dist/drag/index.js +18 -17
- package/dist/{editor/editor.css → easel/easel.css} +16 -1
- package/dist/{editor → easel}/index.d.ts +146 -51
- package/dist/easel/index.js +9 -0
- package/dist/edit-lock/index.d.ts +3 -3
- package/dist/edit-lock/index.js +1 -1
- package/dist/fields/fields.css +103 -26
- package/dist/fields/index.d.ts +51 -13
- package/dist/fields/index.js +30 -46
- package/dist/gold/index.js +1 -1
- package/dist/icons/index.d.ts +10 -1
- package/dist/icons/index.js +1 -1
- package/dist/index.d.ts +3 -3
- package/dist/index.js +1 -1
- package/dist/markup/index.d.ts +94 -10
- package/dist/markup/index.js +1 -1
- package/dist/menu/index.d.ts +61 -6
- package/dist/menu/index.js +15 -15
- package/dist/menu/menu.css +17 -6
- package/dist/node-ops/index.d.ts +9 -9
- package/dist/node-ops/index.js +1 -1
- package/dist/panel/index.d.ts +73 -5
- package/dist/panel/index.js +18 -16
- package/dist/panel/panel.css +56 -1
- package/dist/pick/index.d.ts +42 -4
- package/dist/pick/index.js +7 -14
- package/dist/pick/pick.css +14 -0
- package/dist/rail/index.d.ts +6 -6
- package/dist/rail/index.js +1 -1
- package/dist/rail/rail.css +1 -1
- package/dist/strings/catalogue.d.ts +24 -40
- package/dist/strings/catalogue.js +1 -1
- package/dist/strings/index.d.ts +25 -23
- package/dist/strings/index.js +2 -2
- package/dist/style-clipboard/index.d.ts +5 -5
- package/dist/style-clipboard/index.js +1 -1
- package/dist/text-styles/index.d.ts +328 -0
- package/dist/text-styles/index.js +38 -0
- package/dist/text-styles/text-styles.css +309 -0
- package/dist/tree/index.d.ts +44 -3
- package/dist/tree/index.js +1 -1
- package/dist/tree/tree.css +71 -0
- package/dist/{types-CnRzp9oc.d.ts → types-DGcCsxs8.d.ts} +79 -12
- package/dist/{types-DNrn_w4V.d.ts → types-DWS-s9z-.d.ts} +10 -10
- package/dist/{types-pGBXevBU.d.ts → types-Djdq6Xkd.d.ts} +15 -8
- package/dist/{types-Dy6oR6Z2.d.ts → types-E3HrTPg2.d.ts} +20 -14
- package/dist/{types-C7HFvdtk.d.ts → types-VqL6t5HH.d.ts} +82 -5
- package/dist/{watch-DmasQA61.d.ts → watch-BTYOJpQU.d.ts} +19 -2
- package/dist/{wordFit-9B9nqyf3.d.ts → wordFit-D4S36PvB.d.ts} +1 -1
- package/dist/{words-DagJdwIA.d.ts → words-AHHfiaRY.d.ts} +31 -2
- package/dist/{words-D9ChvbNC.d.ts → words-BDignMl_.d.ts} +1 -1
- package/dist/{words-Cqmyey0s.d.ts → words-BMzV04b1.d.ts} +2 -2
- package/dist/words-CJjUKcV5.d.ts +37 -0
- package/dist/words-CRYvAiHX.d.ts +105 -0
- package/dist/{words-B2YLaKEr.d.ts → words-CnnHb9jo.d.ts} +1 -1
- package/dist/{words-CD3WADyb.d.ts → words-CzoyDNHm.d.ts} +4 -0
- package/dist/{words-bOMsUJk9.d.ts → words-DBq7vfHy.d.ts} +59 -6
- package/dist/{words-DOhF-4D4.d.ts → words-DMG4dYq2.d.ts} +1 -1
- package/dist/{words-BK-npta-.d.ts → words-DgHcY5qB.d.ts} +10 -4
- package/dist/{words-B87GIFWH.d.ts → words-is_Vy6hn.d.ts} +1 -1
- package/package.json +14 -8
- package/dist/chunk-66CKSTXP.js +0 -14
- package/dist/chunk-67VZRQLG.js +0 -13
- package/dist/chunk-6PS6STGA.js +0 -1
- package/dist/chunk-7A7O2JWQ.js +0 -1
- package/dist/chunk-H4B72XCJ.js +0 -1
- package/dist/chunk-JE63JHKO.js +0 -1
- package/dist/chunk-KDIVA6WD.js +0 -1
- package/dist/chunk-MCLBHENY.js +0 -1
- package/dist/chunk-QB3BZIRA.js +0 -5
- package/dist/chunk-SJQG5ENJ.js +0 -1
- package/dist/chunk-SUO5627P.js +0 -1
- package/dist/chunk-ZT7M24XD.js +0 -1
- package/dist/editor/index.js +0 -9
- /package/dist/{chunk-GGTPNGFJ.js → chunk-AELNNAFM.js} +0 -0
package/dist/pick/index.js
CHANGED
|
@@ -1,14 +1,7 @@
|
|
|
1
|
-
import{
|
|
2
|
-
return
|
|
3
|
-
/* @__PURE__ */
|
|
4
|
-
/* @__PURE__ */
|
|
5
|
-
|
|
6
|
-
/* @__PURE__ */
|
|
7
|
-
/* @__PURE__ */
|
|
8
|
-
return i("input",{type:"text",className:"es-pick-hex",value:r??(e?u(e):""),"aria-label":n,maxLength:7,spellCheck:!1,autoComplete:"off",readOnly:l,onChange:t=>{s(t.target.value);const n=c(t.target.value);null!==n&&n!==e&&a(n)},onFocus:e=>e.currentTarget.select(),onKeyDown:e=>{"Enter"!==e.key&&"Escape"!==e.key||(e.preventDefault(),e.stopPropagation(),s(null),e.currentTarget.blur())},onBlur:()=>s(null)})}function f({value:a,onChange:n,label:l,openLibrary:s,kind:o="image",placeholder:c,readOnly:u,words:h=e.image}){const[m,d]=t(!1),[p,v]=t(!1),b=Boolean(s)&&!u,k=async()=>{if(s&&!m&&!u){d(!0),v(!1);try{const e=await s();e&&n(e)}catch{v(!0)}finally{d(!1)}}},f=m?/* @__PURE__ */i("p",{className:"es-pick-image-status",role:"status",children:h.choosing}):p?/* @__PURE__ */i("p",{className:"es-pick-image-status is-error",role:"alert",children:h.failed}):null;if(!a)/* @__PURE__ */
|
|
9
|
-
return r("div",{className:"es-pick-image",children:[
|
|
10
|
-
/* @__PURE__ */r("button",{type:"button",className:"es-pick-image-slot",onClick:k,disabled:!b||m,"aria-label":h.empty({label:l,kind:o,placeholder:c}),children:[
|
|
11
|
-
/* @__PURE__ */i("span",{className:"es-pick-image-slot-name",children:c??("video"===o?h.chooseVideo:h.chooseImage)}),b?/* @__PURE__ */i("span",{className:"es-pick-image-slot-hint",children:h.hint}):null]}),f]});const y=g(a),w=y?h.named({label:l,name:y}):l;/* @__PURE__ */
|
|
12
|
-
return r("div",{className:"es-pick-image",children:[
|
|
13
|
-
/* @__PURE__ */r("figure",{className:"es-pick-image-figure",children:[
|
|
14
|
-
/* @__PURE__ */i("div",{className:"es-pick-image-frame",children:"video"===o?/* @__PURE__ */i("video",{src:a,muted:!0,playsInline:!0,preload:"metadata","aria-label":w}):/* @__PURE__ */i("img",{src:a,alt:w})}),y?/* @__PURE__ */i("figcaption",{className:"es-pick-image-name",title:y,children:y}):null]}),b||!u?/* @__PURE__ */r("div",{className:"es-pick-image-actions",children:[b?/* @__PURE__ */i("button",{type:"button",className:"es-pick-image-btn",onClick:k,disabled:m,"aria-label":h.replaceNamed({label:l}),children:h.replace}):null,u?null:/* @__PURE__ */i("button",{type:"button",className:"es-pick-image-btn is-bare",onClick:()=>n(""),disabled:m,"aria-label":h.removeNamed({label:l}),children:h.remove})]}):null,f]})}export{b as ColourPicker,o as HEX_MAX_LENGTH,f as ImageBox,u as hexReadout,m as hexToHsv,d as hsvToHex,v as hueFromPoint,g as mediaName,p as svFromPoint,c as typedHex};
|
|
1
|
+
import{mediaName as e}from"../chunk-AZT7V4UM.js";export{ColourPicker,ColourWindow,HEX_MAX_LENGTH,hexReadout,hexToHsv,hsvToHex,hueFromPoint,mediaName,svFromPoint,typedHex}from"../chunk-AZT7V4UM.js";import{DEFAULT_PICK_WORDS as a}from"../chunk-ZAOM6PFH.js";import{useState as i}from"react";import{jsx as l,jsxs as s}from"react/jsx-runtime";function c({value:c,onChange:n,label:o,openLibrary:r,kind:t="image",placeholder:m,readOnly:d,words:p=a.image}){const[u,h]=i(!1),[b,g]=i(!1),k=Boolean(r)&&!d,N=async()=>{if(r&&!u&&!d){h(!0),g(!1);try{const e=await r();e&&n(e)}catch{g(!0)}finally{h(!1)}}},f=u?/* @__PURE__ */l("p",{className:"es-pick-image-status",role:"status",children:p.choosing}):b?/* @__PURE__ */l("p",{className:"es-pick-image-status is-error",role:"alert",children:p.failed}):null;if(!c)/* @__PURE__ */
|
|
2
|
+
return s("div",{className:"es-pick-image",children:[
|
|
3
|
+
/* @__PURE__ */s("button",{type:"button",className:"es-pick-image-slot",onClick:N,disabled:!k||u,"aria-label":p.empty({label:o,kind:t,placeholder:m}),children:[
|
|
4
|
+
/* @__PURE__ */l("span",{className:"es-pick-image-slot-name",children:m??("video"===t?p.chooseVideo:p.chooseImage)}),k?/* @__PURE__ */l("span",{className:"es-pick-image-slot-hint",children:p.hint}):null]}),f]});const v=e(c),y=v?p.named({label:o,name:v}):o;/* @__PURE__ */
|
|
5
|
+
return s("div",{className:"es-pick-image",children:[
|
|
6
|
+
/* @__PURE__ */s("figure",{className:"es-pick-image-figure",children:[
|
|
7
|
+
/* @__PURE__ */l("div",{className:"es-pick-image-frame",children:"video"===t?/* @__PURE__ */l("video",{src:c,muted:!0,playsInline:!0,preload:"metadata","aria-label":y}):/* @__PURE__ */l("img",{src:c,alt:y})}),v?/* @__PURE__ */l("figcaption",{className:"es-pick-image-name",title:v,children:v}):null]}),k||!d?/* @__PURE__ */s("div",{className:"es-pick-image-actions",children:[k?/* @__PURE__ */l("button",{type:"button",className:"es-pick-image-btn",onClick:N,disabled:u,"aria-label":p.replaceNamed({label:o}),children:p.replace}):null,d?null:/* @__PURE__ */l("button",{type:"button",className:"es-pick-image-btn is-bare",onClick:()=>n(""),disabled:u,"aria-label":p.removeNamed({label:o}),children:p.remove})]}):null,f]})}export{c as ImageBox};
|
package/dist/pick/pick.css
CHANGED
|
@@ -138,6 +138,20 @@
|
|
|
138
138
|
.es-pick-hue-thumb {
|
|
139
139
|
top: 50%;
|
|
140
140
|
}
|
|
141
|
+
/* The hex row with its swatch (ColourWindow `swatch`, the text box's colour
|
|
142
|
+
window): the colour, then the hex. */
|
|
143
|
+
.es-pick-hex-row {
|
|
144
|
+
display: flex;
|
|
145
|
+
align-items: center;
|
|
146
|
+
gap: 8px;
|
|
147
|
+
}
|
|
148
|
+
.es-pick-hex-swatch {
|
|
149
|
+
width: 26px;
|
|
150
|
+
height: 26px;
|
|
151
|
+
flex: none;
|
|
152
|
+
border-radius: 6px;
|
|
153
|
+
box-shadow: inset 0 0 0 1px rgb(0 0 0 / 0.1);
|
|
154
|
+
}
|
|
141
155
|
|
|
142
156
|
/* ── The image box ──────────────────────────────────────────────────────── */
|
|
143
157
|
.es-pick-image {
|
package/dist/rail/index.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import * as react from 'react';
|
|
2
|
-
import { c as
|
|
3
|
-
export { a as
|
|
2
|
+
import { c as EaselRailProps, E as EaselRailButtonProps } from '../types-DWS-s9z-.js';
|
|
3
|
+
export { a as EaselRailItem, b as EaselRailOrientation } from '../types-DWS-s9z-.js';
|
|
4
4
|
export { AddIcon, LayersIcon, MediaIcon, PageIcon as PagesIcon, IconProps as RailIconProps, SitemapIcon, StylesIcon } from '../icons/index.js';
|
|
5
|
-
export { W as WordFit } from '../wordFit-
|
|
5
|
+
export { W as WordFit } from '../wordFit-D4S36PvB.js';
|
|
6
6
|
|
|
7
7
|
/**
|
|
8
8
|
* The shared icon-rail — one slim strip of icon buttons that every EFFICIENT
|
|
@@ -43,7 +43,7 @@ export { W as WordFit } from '../wordFit-9B9nqyf3.js';
|
|
|
43
43
|
* strings provider — that would be a hook — so a host in another language
|
|
44
44
|
* passes `ariaLabel`; `TopBarRail` does it from the provider.
|
|
45
45
|
*/
|
|
46
|
-
declare function
|
|
46
|
+
declare function EaselRail({ items, ariaLabel, className, orientation, wordFit, }: EaselRailProps): react.JSX.Element;
|
|
47
47
|
|
|
48
48
|
/**
|
|
49
49
|
* A single rail button: an icon in a 34×34 square that hovers, highlights when
|
|
@@ -53,7 +53,7 @@ declare function EditorRail({ items, ariaLabel, className, orientation, wordFit,
|
|
|
53
53
|
* toggle announces its pressed state while an action button (the quick-add "+",
|
|
54
54
|
* whose item omits `active`) stays a plain button rather than a stuck toggle.
|
|
55
55
|
*/
|
|
56
|
-
declare function
|
|
56
|
+
declare function EaselRailButton({ label, worded, icon, active, disabled, onSelect, className, }: EaselRailButtonProps): react.JSX.Element;
|
|
57
57
|
|
|
58
58
|
/**
|
|
59
59
|
* Rail design tokens — the ONE source both apps' rails converge on.
|
|
@@ -142,4 +142,4 @@ declare const railCssVars: {
|
|
|
142
142
|
readonly accentTint: "--es-rail-accent-tint";
|
|
143
143
|
};
|
|
144
144
|
|
|
145
|
-
export {
|
|
145
|
+
export { EaselRail, EaselRailButton, EaselRailButtonProps, EaselRailProps, type RailTokens, railCssVars, railTokens };
|
package/dist/rail/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import"../chunk-OWBO4WKA.js";export{
|
|
1
|
+
import"../chunk-OWBO4WKA.js";export{EaselRail,EaselRailButton,railCssVars,railTokens}from"../chunk-WZ7TGAAT.js";import"../chunk-2OAZYSWJ.js";import"../chunk-BZ5ASXOL.js";export{AddIcon,LayersIcon,MediaIcon,PageIcon as PagesIcon,SitemapIcon,StylesIcon}from"../chunk-6EIVTKZZ.js";
|
package/dist/rail/rail.css
CHANGED
|
@@ -135,7 +135,7 @@
|
|
|
135
135
|
sheet only names the rail's chrome for it — the four inputs below — so a
|
|
136
136
|
re-padded rail button moves its thresholds with it.
|
|
137
137
|
|
|
138
|
-
`is-measured` is set by `
|
|
138
|
+
`is-measured` is set by `EaselRail` when it was handed the words' widths
|
|
139
139
|
(`TopBarRail` measures them). Without it, and without `panel.css`, the word
|
|
140
140
|
stays clipped to nothing: an icon-only rail always fits. */
|
|
141
141
|
.es-rail.es-rail-row.is-measured {
|
|
@@ -1,22 +1,24 @@
|
|
|
1
|
-
import { S as SaveWords } from '../words-
|
|
2
|
-
import { N as NoticeWords, C as ChromeWords } from '../words-
|
|
3
|
-
import { C as CopyWords } from '../words-
|
|
4
|
-
import { D as DragWords } from '../words-
|
|
1
|
+
import { S as SaveWords } from '../words-BMzV04b1.js';
|
|
2
|
+
import { N as NoticeWords, C as ChromeWords } from '../words-AHHfiaRY.js';
|
|
3
|
+
import { C as CopyWords } from '../words-DBq7vfHy.js';
|
|
4
|
+
import { D as DragWords } from '../words-BDignMl_.js';
|
|
5
5
|
import { LockWords } from '../edit-lock/index.js';
|
|
6
|
-
import { F as FieldsWords } from '../words-
|
|
7
|
-
import { N as NodeMenuWords } from '../words-
|
|
8
|
-
import {
|
|
9
|
-
import { P as PickWords } from '../words-
|
|
10
|
-
import { S as StyleClipboardWords } from '../words-
|
|
11
|
-
import { T as
|
|
12
|
-
import '../
|
|
13
|
-
import '../types-
|
|
14
|
-
import '../
|
|
6
|
+
import { F as FieldsWords } from '../words-CzoyDNHm.js';
|
|
7
|
+
import { N as NodeMenuWords } from '../words-DMG4dYq2.js';
|
|
8
|
+
import { P as PanelWords } from '../words-CJjUKcV5.js';
|
|
9
|
+
import { P as PickWords } from '../words-is_Vy6hn.js';
|
|
10
|
+
import { S as StyleClipboardWords } from '../words-CnnHb9jo.js';
|
|
11
|
+
import { T as TextStylesWords } from '../words-CRYvAiHX.js';
|
|
12
|
+
import { T as TreeWords } from '../words-DgHcY5qB.js';
|
|
13
|
+
import '../types-DGcCsxs8.js';
|
|
14
|
+
import '../types-DWS-s9z-.js';
|
|
15
|
+
import '../wordFit-D4S36PvB.js';
|
|
15
16
|
import 'react';
|
|
16
17
|
import '../markup/index.js';
|
|
18
|
+
import '../buckets-CuLM47h9.js';
|
|
17
19
|
|
|
18
20
|
/**
|
|
19
|
-
* The
|
|
21
|
+
* The easel canvas's own words (`efficient-easel/strings`, 0.95.0). There is
|
|
20
22
|
* one: what the frame is called when the host does not name it (`title`).
|
|
21
23
|
*
|
|
22
24
|
* A plain module with no import.
|
|
@@ -26,26 +28,6 @@ type CanvasWords = {
|
|
|
26
28
|
frame: string;
|
|
27
29
|
};
|
|
28
30
|
|
|
29
|
-
/**
|
|
30
|
-
* The settings panel's own words (`efficient-easel/strings`, 0.95.0): what
|
|
31
|
-
* the tab strip is called, and what each tab SAYS.
|
|
32
|
-
*
|
|
33
|
-
* A bucket's key (`'Content'`, `'Style'`, …) is an identifier — fields name
|
|
34
|
-
* their tab with it and `SETTINGS_BUCKETS` orders them — so it never changes
|
|
35
|
-
* with the language. `buckets` is the word drawn for each key.
|
|
36
|
-
*
|
|
37
|
-
* The panel is hook-free, so nothing here is read from the strings provider:
|
|
38
|
-
* `SettingsTabs` takes its name as `ariaLabel` and each tab's word as the
|
|
39
|
-
* item's `label`, and `Inspector` (which has hooks) passes both.
|
|
40
|
-
*/
|
|
41
|
-
|
|
42
|
-
type PanelWords = {
|
|
43
|
-
/** The tab strip's accessible name. */
|
|
44
|
-
settings: string;
|
|
45
|
-
/** The word each tab shows, by its key. */
|
|
46
|
-
buckets: Record<SettingsBucket, string>;
|
|
47
|
-
};
|
|
48
|
-
|
|
49
31
|
/**
|
|
50
32
|
* The rail's own words. There is one: what the toolbar is called when the host
|
|
51
33
|
* does not name it (`ariaLabel`). Every other word on the rail is an item's
|
|
@@ -79,7 +61,7 @@ type RailWords = {
|
|
|
79
61
|
* lane (`tests/*-leaf-safety`), and several are held to a bundle that never
|
|
80
62
|
* spells a browser global — while one sentence below does ("another tab or
|
|
81
63
|
* window"). So a module owns its group and its defaults, and this file only
|
|
82
|
-
* puts the groups side by side. `
|
|
64
|
+
* puts the groups side by side. `DEFAULT_EASEL_STRINGS.pick` IS the pickers'
|
|
83
65
|
* own default object, not a copy of it.
|
|
84
66
|
*
|
|
85
67
|
* ── Framework-free ────────────────────────────────────────────────────────
|
|
@@ -91,7 +73,7 @@ type RailWords = {
|
|
|
91
73
|
*/
|
|
92
74
|
|
|
93
75
|
/** Every word the engine says, by the module that says it. */
|
|
94
|
-
interface
|
|
76
|
+
interface EaselStrings {
|
|
95
77
|
/** `efficient-easel/chrome` — `EditNotice`: who holds the document, a refused save. */
|
|
96
78
|
notice: NoticeWords;
|
|
97
79
|
/** `efficient-easel/edit-lock` — "2 minutes ago", "Someone else". */
|
|
@@ -118,11 +100,13 @@ interface EditorStrings {
|
|
|
118
100
|
styleClipboard: StyleClipboardWords;
|
|
119
101
|
/** `efficient-easel/copy` — the formatting bar, alignment, the link window, each mark. */
|
|
120
102
|
copy: CopyWords;
|
|
121
|
-
/** `efficient-easel/
|
|
103
|
+
/** `efficient-easel/easel` — the canvas frame's name. */
|
|
122
104
|
canvas: CanvasWords;
|
|
105
|
+
/** `efficient-easel/text-styles` — the Email styles / Site styles list (E6). */
|
|
106
|
+
textStyles: TextStylesWords;
|
|
123
107
|
}
|
|
124
108
|
/** Today's English, word for word. */
|
|
125
|
-
declare const
|
|
109
|
+
declare const DEFAULT_EASEL_STRINGS: EaselStrings;
|
|
126
110
|
/**
|
|
127
111
|
* A catalogue with any part left out. A function entry is taken whole or not
|
|
128
112
|
* at all: it has no "part" to leave out.
|
|
@@ -136,6 +120,6 @@ type DeepPartial<T> = T extends (...args: never[]) => unknown ? T : T extends ob
|
|
|
136
120
|
* that has translated half the catalogue shows the other half in English
|
|
137
121
|
* rather than as nothing. Neither argument is changed.
|
|
138
122
|
*/
|
|
139
|
-
declare function
|
|
123
|
+
declare function mergeEaselStrings(defaults: EaselStrings, partial?: DeepPartial<EaselStrings> | null): EaselStrings;
|
|
140
124
|
|
|
141
|
-
export { type CanvasWords, ChromeWords, CopyWords,
|
|
125
|
+
export { type CanvasWords, ChromeWords, CopyWords, DEFAULT_EASEL_STRINGS, type DeepPartial, DragWords, type EaselStrings, FieldsWords, LockWords, NodeMenuWords, NoticeWords, PanelWords, PickWords, type RailWords, SaveWords, StyleClipboardWords, TextStylesWords, TreeWords, mergeEaselStrings };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export{
|
|
1
|
+
export{DEFAULT_EASEL_STRINGS,mergeEaselStrings}from"../chunk-SAJUCHOX.js";import"../chunk-M6F6LS3H.js";import"../chunk-6WY6ZXJG.js";import"../chunk-AELNNAFM.js";import"../chunk-3EDSDPIP.js";import"../chunk-TRVZ7C23.js";import"../chunk-WK3AFPXY.js";import"../chunk-H6DDIBQ4.js";import"../chunk-RE4LP46F.js";import"../chunk-ZJEBF4NB.js";import"../chunk-2OAZYSWJ.js";import"../chunk-JQM3V7XQ.js";import"../chunk-ZAOM6PFH.js";import"../chunk-LA54QLP5.js";import"../chunk-HDVD27VB.js";import"../chunk-O2NLQBFX.js";
|
package/dist/strings/index.d.ts
CHANGED
|
@@ -1,24 +1,26 @@
|
|
|
1
|
-
import { DeepPartial,
|
|
2
|
-
export { CanvasWords,
|
|
1
|
+
import { DeepPartial, EaselStrings } from './catalogue.js';
|
|
2
|
+
export { CanvasWords, DEFAULT_EASEL_STRINGS, RailWords, mergeEaselStrings } from './catalogue.js';
|
|
3
3
|
import * as react from 'react';
|
|
4
4
|
import { ReactNode } from 'react';
|
|
5
|
-
export { C as ChromeWords, N as NoticeWords } from '../words-
|
|
6
|
-
export { C as CopyWords } from '../words-
|
|
7
|
-
export { D as DragWords } from '../words-
|
|
8
|
-
export { F as FieldsWords } from '../words-
|
|
5
|
+
export { C as ChromeWords, N as NoticeWords } from '../words-AHHfiaRY.js';
|
|
6
|
+
export { C as CopyWords } from '../words-DBq7vfHy.js';
|
|
7
|
+
export { D as DragWords } from '../words-BDignMl_.js';
|
|
8
|
+
export { F as FieldsWords } from '../words-CzoyDNHm.js';
|
|
9
9
|
export { LockWords } from '../edit-lock/index.js';
|
|
10
|
-
export { N as NodeMenuWords } from '../words-
|
|
11
|
-
export { P as
|
|
12
|
-
export {
|
|
13
|
-
export { S as
|
|
14
|
-
export {
|
|
15
|
-
|
|
10
|
+
export { N as NodeMenuWords } from '../words-DMG4dYq2.js';
|
|
11
|
+
export { P as PanelWords } from '../words-CJjUKcV5.js';
|
|
12
|
+
export { P as PickWords } from '../words-is_Vy6hn.js';
|
|
13
|
+
export { S as SaveWords } from '../words-BMzV04b1.js';
|
|
14
|
+
export { S as StyleClipboardWords } from '../words-CnnHb9jo.js';
|
|
15
|
+
export { T as TextStylesWords } from '../words-CRYvAiHX.js';
|
|
16
|
+
export { T as TreeWords } from '../words-DgHcY5qB.js';
|
|
16
17
|
import '../markup/index.js';
|
|
17
|
-
import '../
|
|
18
|
-
import '../types-
|
|
19
|
-
import '../
|
|
18
|
+
import '../buckets-CuLM47h9.js';
|
|
19
|
+
import '../types-DGcCsxs8.js';
|
|
20
|
+
import '../types-DWS-s9z-.js';
|
|
21
|
+
import '../wordFit-D4S36PvB.js';
|
|
20
22
|
|
|
21
|
-
interface
|
|
23
|
+
interface EaselStringsProviderProps {
|
|
22
24
|
/**
|
|
23
25
|
* The host's words, laid over the ones in reach — the engine's English, or an
|
|
24
26
|
* outer provider's. Anything left out keeps what was there.
|
|
@@ -27,10 +29,10 @@ interface EditorStringsProviderProps {
|
|
|
27
29
|
* a `useMemo`): a new object every render is a new catalogue every render,
|
|
28
30
|
* and everything that reads it draws again.
|
|
29
31
|
*/
|
|
30
|
-
value?: DeepPartial<
|
|
32
|
+
value?: DeepPartial<EaselStrings>;
|
|
31
33
|
/**
|
|
32
34
|
* The language those words are in, as a BCP 47 tag (`'de'`, `'zh-Hant'`). The
|
|
33
|
-
* engine does not read it; `
|
|
35
|
+
* engine does not read it; `useEaselLocale()` hands it to a host's blocks and
|
|
34
36
|
* fields, so a number or a date drawn in the editor follows the same language.
|
|
35
37
|
* Left out: an outer provider's, else `'en'`.
|
|
36
38
|
*/
|
|
@@ -45,12 +47,12 @@ interface EditorStringsProviderProps {
|
|
|
45
47
|
* primitives, the Layers tree, the pickers, the Add panel, the canvas layer —
|
|
46
48
|
* and neither do the plain functions (`editNotice`, `saveIndicator`,
|
|
47
49
|
* `nodeMenuItems`, …). Each takes its group as a prop or an argument instead;
|
|
48
|
-
* a host hands it `
|
|
50
|
+
* a host hands it `useEaselStrings()`'s.
|
|
49
51
|
*/
|
|
50
|
-
declare function
|
|
52
|
+
declare function EaselStringsProvider({ value, locale, children }: EaselStringsProviderProps): react.JSX.Element;
|
|
51
53
|
/** The whole catalogue: the nearest provider's, or the engine's English. */
|
|
52
|
-
declare function
|
|
54
|
+
declare function useEaselStrings(): EaselStrings;
|
|
53
55
|
/** The nearest provider's locale, or `'en'`. */
|
|
54
|
-
declare function
|
|
56
|
+
declare function useEaselLocale(): string;
|
|
55
57
|
|
|
56
|
-
export { DeepPartial,
|
|
58
|
+
export { DeepPartial, EaselStrings, EaselStringsProvider, type EaselStringsProviderProps, useEaselLocale, useEaselStrings };
|
package/dist/strings/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{
|
|
2
|
-
return
|
|
1
|
+
import{DEFAULT_EASEL_STRINGS as r,mergeEaselStrings as n}from"../chunk-SAJUCHOX.js";export{DEFAULT_EASEL_STRINGS,mergeEaselStrings}from"../chunk-SAJUCHOX.js";import"../chunk-M6F6LS3H.js";import"../chunk-6WY6ZXJG.js";import"../chunk-AELNNAFM.js";import"../chunk-3EDSDPIP.js";import"../chunk-TRVZ7C23.js";import"../chunk-WK3AFPXY.js";import"../chunk-H6DDIBQ4.js";import"../chunk-RE4LP46F.js";import"../chunk-ZJEBF4NB.js";import"../chunk-2OAZYSWJ.js";import"../chunk-JQM3V7XQ.js";import"../chunk-ZAOM6PFH.js";import"../chunk-LA54QLP5.js";import"../chunk-HDVD27VB.js";import{stringsContext as o}from"../chunk-MFIRYGHW.js";import"../chunk-O2NLQBFX.js";import{useContext as t,useMemo as c}from"react";import{jsx as i}from"react/jsx-runtime";function s({value:s,locale:u,children:m}){const e=o(),p=t(e),h=p?.strings??r,j=u??p?.locale??"en",k=c(()=>({strings:n(h,s),locale:j}),[h,s,j]);/* @__PURE__ */
|
|
2
|
+
return i(e.Provider,{value:k,children:m})}function u(){return t(o())?.strings??r}function m(){return t(o())?.locale??"en"}export{s as EaselStringsProvider,m as useEaselLocale,u as useEaselStrings};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { E as
|
|
2
|
-
import { S as StyleClipboardWords } from '../words-
|
|
1
|
+
import { E as EaselContextMenuItem } from '../types-Djdq6Xkd.js';
|
|
2
|
+
import { S as StyleClipboardWords } from '../words-CnnHb9jo.js';
|
|
3
3
|
import 'react';
|
|
4
4
|
|
|
5
5
|
/**
|
|
@@ -143,7 +143,7 @@ declare function planPaste(snapshot: StyleSnapshot, target: {
|
|
|
143
143
|
}): PastePlan;
|
|
144
144
|
/** The words a merchant reads after a paste. One copy, so both editors say the
|
|
145
145
|
* same thing — including, plainly, when nothing matched. `words` is the host's
|
|
146
|
-
* language (`
|
|
146
|
+
* language (`useEaselStrings().styleClipboard`, 0.95.0); left out, English. */
|
|
147
147
|
declare function pasteMessage(plan: Pick<PastePlan, 'pasted'>, sourceLabel: string, targetLabel: string, words?: StyleClipboardWords): string;
|
|
148
148
|
/** The two shortcuts, as a menu draws them. */
|
|
149
149
|
declare const COPY_STYLE_SHORTCUT = "\u2325\u2318C";
|
|
@@ -161,9 +161,9 @@ declare function styleMenuItems(opts: {
|
|
|
161
161
|
canCopy: boolean;
|
|
162
162
|
onCopy: () => void;
|
|
163
163
|
onPaste: () => void;
|
|
164
|
-
/** The rows' words in the host's language (`
|
|
164
|
+
/** The rows' words in the host's language (`useEaselStrings().styleClipboard`, 0.95.0). Left out, English. */
|
|
165
165
|
words?: StyleClipboardWords;
|
|
166
|
-
}):
|
|
166
|
+
}): EaselContextMenuItem[];
|
|
167
167
|
/**
|
|
168
168
|
* Is this key press Copy style or Paste style?
|
|
169
169
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{DEFAULT_STYLE_CLIPBOARD_WORDS as t}from"../chunk-6WY6ZXJG.js";import{CopyStyleIcon as e,PasteStyleIcon as n}from"../chunk-
|
|
1
|
+
import{DEFAULT_STYLE_CLIPBOARD_WORDS as t}from"../chunk-6WY6ZXJG.js";import{CopyStyleIcon as e,PasteStyleIcon as n}from"../chunk-6EIVTKZZ.js";import{jsx as o}from"react/jsx-runtime";var r="__styleKind";function u(t,e){return t[r]=e,t}function c(t,e){return`${t}:${e.map(t=>String(t)).sort().join("|")}`}function i(t){if(!t)return null;const e=t.indexOf(":");if(e<0)return null;const n=t.slice(0,e);return s.has(n)?{control:n,values:t.slice(e+1).split("|")}:null}var s=/* @__PURE__ */new Set(["choice","select","radio"]);function l(t){if(!t||"object"!=typeof t)return null;const e=t;return"string"==typeof e[r]?e[r]:"text"===e.type||"textarea"===e.type||"number"===e.type?e.type:"select"!==e.type&&"radio"!==e.type||!Array.isArray(e.options)?null:c(e.type,e.options.map(t=>t?.value))}function a(t){return null!=t&&""!==t}function p(t,e){let n=t;for(const t of e){if(!n||"object"!=typeof n)return;n=n[t]}return n}function f(t){return void 0===t?t:JSON.parse(JSON.stringify(t))}function d(t,e,n){const[o,...r]=e,u={...t};if(0===r.length)return void 0===n?delete u[o]:u[o]=n,u;const c=u[o],i=d(c&&"object"==typeof c?c:{},r,n);return 0===Object.keys(i).length?delete u[o]:u[o]=i,u}var y=t=>t.join("."),h="editor-shell:style-clipboard",g=null,m=!1,v=/* @__PURE__ */new Set;function S(){try{return"undefined"==typeof sessionStorage?null:sessionStorage}catch{return null}}function b(){if(!m){m=!0;try{const t=S()?.getItem(h);t&&(g=JSON.parse(t))}catch{g=null}}}function k(t){b(),g={scope:t.scope,sourceType:t.type,sourceLabel:t.label,rows:t.rows.map(e=>{const n=p(t.props,e.path);return{path:[...e.path],kind:e.kind,counted:!1!==e.counted,value:a(n)?f(n):void 0}})};try{S()?.setItem(h,JSON.stringify(g))}catch{}return v.forEach(t=>t()),g}function N(t){return b(),g&&g.scope===t?g:null}function j(t){return v.add(t),()=>{v.delete(t)}}function C(){g=null,m=!0;try{S()?.removeItem(h)}catch{}v.forEach(t=>t())}function w(t,e,n){if(t.kind===e.kind)return null!==e.kind||n;const o=i(t.kind),r=i(e.kind);return!(!o||!r||o.control!==r.control)&&(!a(t.value)||r.values.includes(String(t.value)))}function E(t,e){const n=t.sourceType===e.type,o=new Map(t.rows.map(t=>[y(t.path),t]));let r=e.props,u=0,c=!1;for(const t of e.rows){const e=o.get(y(t.path));if(!e)continue;if(!w(e,t,n))continue;const i=p(r,t.path),s=void 0===e.value?void 0:f(e.value);JSON.stringify(a(i)?i:void 0)!==JSON.stringify(s)&&(r=d(r,t.path,s),c=!0),!1!==t.counted&&(u+=1)}return{props:r,pasted:u,changed:c}}function K(e,n,o,r=t){return 0===e.pasted?r.nothing({source:n,target:o}):r.pasted({count:e.pasted,source:n})}var O="⌥⌘C",J="⌥⌘V";function T(r){const u=r.words??t,c=[];return r.canCopy&&c.push({label:u.copy,icon:/* @__PURE__ */o(e,{}),shortcut:"⌥⌘C",onClick:r.onCopy}),r.held&&c.push({label:u.paste({source:r.held.sourceLabel}),icon:/* @__PURE__ */o(n,{}),shortcut:"⌥⌘V",onClick:r.onPaste}),c}function x(t){if(!t.altKey||t.shiftKey||!t.metaKey&&!t.ctrlKey)return null;const e=t.target;return e&&(e.isContentEditable||"INPUT"===e.tagName||"TEXTAREA"===e.tagName||"SELECT"===e.tagName)?null:"KeyC"===t.code?"copy":"KeyV"===t.code?"paste":null}export{O as COPY_STYLE_SHORTCUT,J as PASTE_STYLE_SHORTCUT,r as STYLE_KIND,c as choiceKind,C as clearStyle,k as copyStyle,l as fieldKind,N as heldStyle,K as pasteMessage,E as planPaste,T as styleMenuItems,x as styleShortcut,j as subscribeStyle,u as withStyleKind};
|