efficient-web-builder 5.0.1 → 5.0.2

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/CHANGELOG.md CHANGED
@@ -1,5 +1,18 @@
1
1
  # Changelog
2
2
 
3
+ ## 5.0.2 - 2026-10-12
4
+
5
+ - **The copy box bar no longer offers the three word styles.** Highlight,
6
+ Bold and Quiet were dropped from the toolbar by the owner on 2026-10-02,
7
+ but the website editor still drew them on every copy box and list row
8
+ (the Ticker items too). `SHOP_COPY_FIELD_TOOLS` and `shopMarkupTools()`
9
+ now list only the grammar's own marks: Bold, Italic and Strikethrough,
10
+ then Clear formatting.
11
+ - **Saved word-style copy is unchanged.** `@@`, `++` and `^^` still read and
12
+ still paint (`WORD_STYLE_RULES` stays in `SHOP_MARKUP`), and
13
+ `WORD_STYLE_TOOLS`, `applyShopMark` and `shopMarkedAt` are still exported.
14
+ The dead Quiet glyph in `MarkupToolbar` is gone.
15
+
3
16
  ## 5.0.1 - 2026-10-11
4
17
 
5
18
  - **A custom face's Style box is read as it is seen.** For a text part whose
@@ -1,2 +1,2 @@
1
- import{applyMark as q,markupTools as w,MARKUP_TOOLS as C,COPY_FIELD_TOOLS as $,STOREFRONT_MARKUP as j,tokenizeInline as B,stripInline as H,isSafeLinkHref as z}from"efficient-easel/markup";import{applyMark as g,markedAt as k,markupTools as R,MARKUP_TOOLS as m,parseMarkup as L,RETIRED_MARKS as d,STOREFRONT_MARKUP as a,tokenizeInline as M}from"efficient-easel/markup";import{WORD_STYLES as u,WORD_STYLE_LABELS as r,WORD_STYLE_MARKS as o}from"./word-styles.js";const f=u.map(e=>({open:o[e].delimiter,close:o[e].delimiter,kind:o[e].kind})),h=[{style:o.highlight.kind,label:r.highlight,title:`${r.highlight} word style`},{style:o.strong.kind,label:r.strong,title:`${r.strong} word style`},{style:o.quiet.kind,label:r.quiet,title:`${r.quiet} word style`}],Y=new Set(f.map(e=>e.open)),c=[...a.filter(e=>!Y.has(e.open)),...f];function W(e){return M(e,c)}function y(e){return e.bullet?"- ":e.number!=null?`${e.number}. `:""}function A(e){return L(typeof e=="string"?e:"",c)}const x=["quiet"],S=[...m.map(e=>e.style).filter(e=>!x.includes(e)&&!d.includes(e)),...h.map(e=>e.style)].filter(e=>c.some(n=>n.kind===e));function b(){return[...R(S),...h].filter(e=>S.includes(e.style))}const _=Object.fromEntries(u.map(e=>[o[e].kind,o[e].delimiter]));function I(e,n,i,l){const t=_[l];if(!t)return g(e,n,i,l);const s=e.slice(n,i),E=e.slice(Math.max(0,n-t.length),n),T=e.slice(i,i+t.length);if(E===t&&T===t)return{text:e.slice(0,n-t.length)+s+e.slice(i+t.length),selectionStart:n-t.length,selectionEnd:n-t.length+s.length};const p=s||"styled text";return{text:e.slice(0,n)+t+p+t+e.slice(i),selectionStart:n+t.length,selectionEnd:n+t.length+p.length}}function K(e,n,i,l){const t=_[l];return t?n>=t.length&&e.slice(n-t.length,n)===t&&e.slice(i,i+t.length)===t:k(e,n,i,l)}function F(e){return A(e).map(n=>y(n)+O(n.children)).join(`
2
- `)}function O(e){return e.map(n=>n.kind==="text"?n.text:O(n.children)).join("")}export{$ as COPY_FIELD_TOOLS,C as MARKUP_TOOLS,S as SHOP_COPY_FIELD_TOOLS,c as SHOP_MARKUP,j as STOREFRONT_MARKUP,f as WORD_STYLE_RULES,h as WORD_STYLE_TOOLS,q as applyMark,I as applyShopMark,z as isSafeLinkHref,y as linePrefix,w as markupTools,K as shopMarkedAt,b as shopMarkupTools,A as storefrontLines,W as storefrontTokens,H as stripInline,F as stripMarkup,B as tokenizeInline};
1
+ import{applyMark as w,markupTools as C,MARKUP_TOOLS as N,COPY_FIELD_TOOLS as $,STOREFRONT_MARKUP as j,tokenizeInline as q,stripInline as H,isSafeLinkHref as z}from"efficient-easel/markup";import{applyMark as g,markedAt as k,markupTools as E,MARKUP_TOOLS as T,parseMarkup as m,RETIRED_MARKS as R,STOREFRONT_MARKUP as L,tokenizeInline as d}from"efficient-easel/markup";import{WORD_STYLES as u,WORD_STYLE_LABELS as r,WORD_STYLE_MARKS as o}from"./word-styles.js";const f=u.map(e=>({open:o[e].delimiter,close:o[e].delimiter,kind:o[e].kind})),Y=[{style:o.highlight.kind,label:r.highlight,title:`${r.highlight} word style`},{style:o.strong.kind,label:r.strong,title:`${r.strong} word style`},{style:o.quiet.kind,label:r.quiet,title:`${r.quiet} word style`}],a=new Set(f.map(e=>e.open)),p=[...L.filter(e=>!a.has(e.open)),...f];function D(e){return d(e,p)}function M(e){return e.bullet?"- ":e.number!=null?`${e.number}. `:""}function x(e){return m(typeof e=="string"?e:"",p)}const y=T.map(e=>e.style).filter(e=>!R.includes(e)).filter(e=>p.some(n=>n.kind===e));function b(){return E(y)}const h=Object.fromEntries(u.map(e=>[o[e].kind,o[e].delimiter]));function K(e,n,i,l){const t=h[l];if(!t)return g(e,n,i,l);const s=e.slice(n,i),O=e.slice(Math.max(0,n-t.length),n),_=e.slice(i,i+t.length);if(O===t&&_===t)return{text:e.slice(0,n-t.length)+s+e.slice(i+t.length),selectionStart:n-t.length,selectionEnd:n-t.length+s.length};const c=s||"styled text";return{text:e.slice(0,n)+t+c+t+e.slice(i),selectionStart:n+t.length,selectionEnd:n+t.length+c.length}}function W(e,n,i,l){const t=h[l];return t?n>=t.length&&e.slice(n-t.length,n)===t&&e.slice(i,i+t.length)===t:k(e,n,i,l)}function F(e){return x(e).map(n=>M(n)+S(n.children)).join(`
2
+ `)}function S(e){return e.map(n=>n.kind==="text"?n.text:S(n.children)).join("")}export{$ as COPY_FIELD_TOOLS,N as MARKUP_TOOLS,y as SHOP_COPY_FIELD_TOOLS,p as SHOP_MARKUP,j as STOREFRONT_MARKUP,f as WORD_STYLE_RULES,Y as WORD_STYLE_TOOLS,w as applyMark,K as applyShopMark,z as isSafeLinkHref,M as linePrefix,C as markupTools,W as shopMarkedAt,b as shopMarkupTools,x as storefrontLines,D as storefrontTokens,H as stripInline,F as stripMarkup,q as tokenizeInline};
@@ -1 +1 @@
1
- import{jsx as e,Fragment as u,jsxs as p}from"react/jsx-runtime";import{useEffect as g,useState as M}from"react";import{MarkBar as S,markSelection as E,useCaretEdit as L}from"efficient-easel/copy";import{RevertIcon as v}from"efficient-easel/icons";import{IconButton as b,Tooltip as j}from"efficient-shell/ui";import{applyShopMark as z,shopMarkedAt as A,shopMarkupTools as T,stripMarkup as C}from"../markup.js";function H({style:t}){const n=r=>e("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:1.9,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:r});switch(t){case"bold":return n(e("path",{d:"M7 5h6.5a3.5 3.5 0 0 1 0 7H7zm0 7h7.5a3.5 3.5 0 0 1 0 7H7z"}));case"italic":return n(p(u,{children:[e("line",{x1:"10",y1:"5",x2:"19",y2:"5"}),e("line",{x1:"5",y1:"19",x2:"14",y2:"19"}),e("line",{x1:"14",y1:"5",x2:"10",y2:"19"})]}));case"strike":return n(p(u,{children:[e("path",{d:"M16.5 6.5A4.2 4.2 0 0 0 12.7 4.7C10 4.7 8.4 6 8.4 7.9c0 1.6 1.2 2.5 3.4 3.1"}),e("path",{d:"M7.6 17.4A4.4 4.4 0 0 0 11.7 19.3c2.8 0 4.5-1.4 4.5-3.4 0-1-.4-1.8-1.2-2.4"}),e("line",{x1:"4",y1:"12",x2:"20",y2:"12"})]}));case"highlight":return n(p(u,{children:[e("path",{d:"M14.5 4.5l5 5-8 8H6.5v-5z"}),e("line",{x1:"4",y1:"21",x2:"20",y2:"21"})]}));case"quiet":return n(p(u,{children:[e("path",{d:"M12 4.5l5.5 7.5L12 19.5 6.5 12z"}),e("line",{x1:"9.4",y1:"12",x2:"14.6",y2:"12"})]}));default:return null}}const _=["bold","italic","strike","highlight"],D=Object.fromEntries(_.map(t=>[t,e(H,{style:t},t)])),y="Clear formatting";function B(t,n,r){return E(t,n,r,z)}function F(t){const[n,r]=M(null);return g(()=>{const o=t.current?.ownerDocument??(typeof document>"u"?null:document);if(!o)return;const a=()=>{const s=t.current;if(!s||o.activeElement!==s)return;const i=s.selectionStart??s.value.length,d=s.selectionEnd??i;r(c=>c&&c.start===i&&c.end===d?c:{start:i,end:d})};return o.addEventListener("selectionchange",a),()=>o.removeEventListener("selectionchange",a)},[t]),[n,r]}function I({target:t,value:n,onChange:r,disabled:o=!1,label:a="Formatting"}){const s=L({target:t,onChange:r}),[i,d]=F(t),c=l=>s(k=>{const h=B(n,l,k);return d({start:h.selectionStart,end:h.selectionEnd}),h}),m=T(),f={};if(i)for(const l of m)f[l.style]=A(n,i.start,i.end,l.style);const x=C(n);return e(S,{tools:m,onApply:c,pressed:f,disabled:o,glyphs:D,ariaLabel:a,actions:e("span",{className:"sf-markup-clear",children:e(j,{content:y,children:e(b,{size:"sm",onMouseDown:l=>l.preventDefault(),onClick:()=>r(x),disabled:o||x===n,"aria-label":y,children:e(v,{size:14})})})})})}var P=I;export{I as MarkupToolbar,P as default,B as markSelection};
1
+ import{jsx as e,Fragment as p,jsxs as h}from"react/jsx-runtime";import{useEffect as g,useState as M}from"react";import{MarkBar as S,markSelection as E,useCaretEdit as v}from"efficient-easel/copy";import{RevertIcon as L}from"efficient-easel/icons";import{IconButton as b,Tooltip as j}from"efficient-shell/ui";import{applyShopMark as A,shopMarkedAt as T,shopMarkupTools as z,stripMarkup as C}from"../markup.js";function H({style:t}){const n=r=>e("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:1.9,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:r});switch(t){case"bold":return n(e("path",{d:"M7 5h6.5a3.5 3.5 0 0 1 0 7H7zm0 7h7.5a3.5 3.5 0 0 1 0 7H7z"}));case"italic":return n(h(p,{children:[e("line",{x1:"10",y1:"5",x2:"19",y2:"5"}),e("line",{x1:"5",y1:"19",x2:"14",y2:"19"}),e("line",{x1:"14",y1:"5",x2:"10",y2:"19"})]}));case"strike":return n(h(p,{children:[e("path",{d:"M16.5 6.5A4.2 4.2 0 0 0 12.7 4.7C10 4.7 8.4 6 8.4 7.9c0 1.6 1.2 2.5 3.4 3.1"}),e("path",{d:"M7.6 17.4A4.4 4.4 0 0 0 11.7 19.3c2.8 0 4.5-1.4 4.5-3.4 0-1-.4-1.8-1.2-2.4"}),e("line",{x1:"4",y1:"12",x2:"20",y2:"12"})]}));case"highlight":return n(h(p,{children:[e("path",{d:"M14.5 4.5l5 5-8 8H6.5v-5z"}),e("line",{x1:"4",y1:"21",x2:"20",y2:"21"})]}));default:return null}}const _=["bold","italic","strike","highlight"],D=Object.fromEntries(_.map(t=>[t,e(H,{style:t},t)])),k="Clear formatting";function B(t,n,r){return E(t,n,r,A)}function F(t){const[n,r]=M(null);return g(()=>{const o=t.current?.ownerDocument??(typeof document>"u"?null:document);if(!o)return;const a=()=>{const s=t.current;if(!s||o.activeElement!==s)return;const i=s.selectionStart??s.value.length,d=s.selectionEnd??i;r(c=>c&&c.start===i&&c.end===d?c:{start:i,end:d})};return o.addEventListener("selectionchange",a),()=>o.removeEventListener("selectionchange",a)},[t]),[n,r]}function I({target:t,value:n,onChange:r,disabled:o=!1,label:a="Formatting"}){const s=v({target:t,onChange:r}),[i,d]=F(t),c=l=>s(y=>{const u=B(n,l,y);return d({start:u.selectionStart,end:u.selectionEnd}),u}),m=z(),f={};if(i)for(const l of m)f[l.style]=T(n,i.start,i.end,l.style);const x=C(n);return e(S,{tools:m,onApply:c,pressed:f,disabled:o,glyphs:D,ariaLabel:a,actions:e("span",{className:"sf-markup-clear",children:e(j,{content:k,children:e(b,{size:"sm",onMouseDown:l=>l.preventDefault(),onClick:()=>r(x),disabled:o||x===n,"aria-label":k,children:e(L,{size:14})})})})})}var P=I;export{I as MarkupToolbar,P as default,B as markSelection};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "efficient-web-builder",
3
- "version": "5.0.1",
3
+ "version": "5.0.2",
4
4
  "description": "The EFFICIENT website builder: the website editor, the general sections and the renderer that draws them, compiled. Hostable by any EFFICIENT product; nothing here imports a host.",
5
5
  "license": "UNLICENSED",
6
6
  "author": "Efficient Pty Ltd",