@solibo/solibo-ui 1.0.10 → 1.0.11
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/assets/index10.css +1 -1
- package/dist/assets/index26.css +1 -1
- package/dist/assets/index38.css +1 -1
- package/dist/assets/index41.css +1 -1
- package/dist/components/aside/index.cjs +1 -1
- package/dist/components/aside/index.js +18 -18
- package/dist/components/dialog/index.cjs +1 -1
- package/dist/components/dialog/index.js +38 -38
- package/dist/components/editor/index.cjs +1 -1
- package/dist/components/editor/index.cjs.map +1 -1
- package/dist/components/editor/index.js +3 -3
- package/dist/components/portal/index.cjs +1 -1
- package/dist/components/portal/index.js +15 -15
- package/dist/tokens.json +1 -1
- package/package.json +1 -1
package/dist/assets/index10.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
:root{--pseudo-selected-width: 3px}@keyframes
|
|
1
|
+
:root{--pseudo-selected-width: 3px}@keyframes _reveal_1j8wd_1{0%{opacity:0}to{opacity:1}}@property --portal-left{syntax: "<color>"; inherits: true; initial-value: white;}@property --portal-middle{syntax: "<color>"; inherits: true; initial-value: white;}@property --portal-right{syntax: "<color>"; inherits: true; initial-value: white;}@property --gradient-angle{syntax: "<angle>"; inherits: true; initial-value: 180deg;}._portal_1j8wd_41{align-self:start;background:linear-gradient(var(--gradient-angle),var(--portal-left) 7%,var(--portal-middle) 28%,var(--portal-middle) 68.5%,var(--portal-right) 90%);animation:_reveal_1j8wd_1 var(--utils-tokens-transition-duration) var(--utils-tokens-transition-timing-function);border-radius:var(--shape-border-radius-radius-md);color:var(--colors-neutral-0);display:flex;flex-direction:column;height:calc(100vh - var(--utils-tokens-unit));margin:var(--shape-spacing-xs);padding:var(--shape-spacing-lg) var(--shape-spacing-xs) var(--shape-spacing-xs) var(--shape-spacing-xs);top:var(--shape-spacing-xs);transition:background var(--utils-tokens-transition-duration) var(--utils-tokens-transition-timing-function),border-radius var(--utils-tokens-transition-duration) var(--utils-tokens-transition-timing-function),height var(--utils-tokens-transition-duration) var(--utils-tokens-transition-timing-function),margin var(--utils-tokens-transition-duration) var(--utils-tokens-transition-timing-function),--portal-left calc(var(--utils-tokens-transition-duration) * 2) var(--utils-tokens-transition-timing-function),--portal-middle calc(var(--utils-tokens-transition-duration) * 2) var(--utils-tokens-transition-timing-function),--portal-right calc(var(--utils-tokens-transition-duration) * 2) var(--utils-tokens-transition-timing-function);width:calc(var(--utils-tokens-unit) * 14);z-index:5}._portal_1j8wd_41:has(nav [data-portal=blue][data-active]),._portal_1j8wd_41:has(nav [data-portal=blue][aria-current=page]){--portal-left: #073345;--portal-middle: #015e78;--portal-right: #073345}._portal_1j8wd_41:has(nav [data-portal=green][data-active]),._portal_1j8wd_41:has(nav [data-portal=green][aria-current=page]){--portal-left: #022c22;--portal-middle: #166045;--portal-right: #022c22}._portal_1j8wd_41:has(nav [data-portal=red][data-active]),._portal_1j8wd_41:has(nav [data-portal=red][aria-current=page]){--portal-left: #431407;--portal-middle: #7c2d12;--portal-right: #431407}._portal_1j8wd_41 figure{display:flex;align-self:center;margin-bottom:calc(var(--utils-tokens-unit) - 4px)}._portal_1j8wd_41 figure figcaption{display:none}._portal_1j8wd_41 footer{border-top:solid var(--scale-1) var(--colors-translucent);padding-top:var(--shape-spacing-xs);width:calc(100% - var(--utils-tokens-unit))}._portal_1j8wd_41 nav{display:flex;flex:1 1 auto;flex-direction:column;min-height:0}._portal_1j8wd_41 nav a,._portal_1j8wd_41 nav summary{color:var(--colors-semantic-bg-surface);padding:var(--shape-spacing-xs);text-decoration:none;font-weight:var(--font-font-weight-regular)}._portal_1j8wd_41 nav a [data-component=icon],._portal_1j8wd_41 nav summary [data-component=icon]{background-color:var(--colors-semantic-bg-surface);margin-bottom:var(--scale-4);margin-right:var(--scale-8)}._portal_1j8wd_41 nav a[aria-current=page],._portal_1j8wd_41 nav summary[aria-current=page]{font-weight:var(--font-font-weight-bold)}._portal_1j8wd_41 nav details>summary{white-space:nowrap}._portal_1j8wd_41 nav details>summary [data-content=collapsible-summary]{overflow:hidden;text-overflow:ellipsis}._portal_1j8wd_41 nav details>summary [data-content=collapsible-indicator] [data-component=icon]{height:calc(var(--utils-tokens-unit) * 1.5);margin-bottom:0;margin-right:0;width:calc(var(--utils-tokens-unit) * 1.5)}._portal_1j8wd_41 nav details a{border-top-right-radius:var(--shape-border-radius-radius-sm);border-bottom-right-radius:var(--shape-border-radius-radius-sm);margin-left:calc(var(--utils-tokens-unit) + var(--scale-4));padding-left:var(--utils-tokens-unit);position:relative;width:calc(100% - var(--utils-tokens-unit) - var(--scale-8))}._portal_1j8wd_41 nav details a:before{background-color:var(--colors-neutral-0);content:"";display:inline-block;height:100%;left:0;position:absolute;top:0;transition:width var(--utils-tokens-transition-duration);width:var(--scale-1)}._portal_1j8wd_41 nav details a[aria-current=page]:before{left:-1px;width:var(--pseudo-selected-width)}._portal_1j8wd_41 nav details a[aria-current=page]{background-color:#00000017}._portal_1j8wd_41 nav details a:hover:not([aria-current=page]){background-color:#ffffff54}._portal_1j8wd_41 nav details a:last-child:not([aria-current=page]){margin-bottom:var(--utils-tokens-unit)}._portal_1j8wd_41 nav[data-orientation=horizontal]{align-items:center;border-bottom:solid var(--scale-1) var(--colors-semantic-border-strong);display:flex;flex:0 0 auto;flex-direction:row;gap:var(--shape-spacing-lg);margin-bottom:var(--utils-tokens-unit);justify-self:center;justify-content:center;width:100%}._portal_1j8wd_41 nav[data-orientation=horizontal] a{border-bottom:solid var(--scale-2) transparent;font-size:var(--typography-font-sizes-caption);padding:var(--scale-8) 0;transition:all}._portal_1j8wd_41 nav[data-orientation=horizontal] a[data-active]{border-bottom:solid var(--scale-2) var(--colors-semantic-bg-surface);font-weight:var(--font-font-weight-bold)}._portal_1j8wd_41 nav[data-orientation=horizontal] a:hover:not([data-active]){color:var(--colors-semantic-bg-surface);text-decoration:none}._portal_1j8wd_41 nav [data-component=group]{flex:1 1 auto;min-height:0;overflow-y:auto;overscroll-behavior:contain}@supports (-moz-appearance: none){._portal_1j8wd_41 nav [data-component=group]{scrollbar-color:var(--colors-semantic-border-default) transparent;scrollbar-width:thin}}@supports selector(::-webkit-scrollbar){._portal_1j8wd_41 nav [data-component=group]::-webkit-scrollbar{height:var(--scale-2);width:var(--scale-2)}._portal_1j8wd_41 nav [data-component=group]::-webkit-scrollbar-track{background-color:transparent}._portal_1j8wd_41 nav [data-component=group]::-webkit-scrollbar-thumb{background-color:var(--colors-semantic-border-default);border-radius:var(--scale-4)}}._portal_1j8wd_41 select{background-color:var(--colors-translucent);border:none;box-shadow:none;filter:invert(1);margin-bottom:var(--utils-tokens-unit);padding-bottom:var(--scale-8);padding-top:var(--scale-8);width:100%}._portal_1j8wd_41 select:active,._portal_1j8wd_41 select:focus{outline:none}._portal_1j8wd_41 ._content_1j8wd_251{display:flex;flex:1 1 auto;flex-direction:column;min-height:0}._portal_1j8wd_41 ._toggle_1j8wd_258{display:none}@media (width <= 1024px){._menu_1j8wd_265{padding:0}._menu_1j8wd_265>summary{left:var(--utils-tokens-unit);top:var(--utils-tokens-unit)}._portal_1j8wd_41{--gradient-angle: 90deg;border-radius:0;height:calc(var(--utils-tokens-unit) * 4);margin:0;padding-top:var(--shape-spacing-sm);position:fixed;top:0;transition:height var(--utils-tokens-transition-duration),width var(--utils-tokens-transition-duration),--gradient-angle var(--utils-tokens-transition-duration) var(--utils-tokens-transition-timing-function);width:100vw}._portal_1j8wd_41 ._content_1j8wd_251{max-height:0;opacity:0;overflow:hidden;transition:opacity var(--utils-tokens-transition-duration),visibility 0s var(--utils-tokens-transition-duration);visibility:hidden}._portal_1j8wd_41 ._toggle_1j8wd_258{align-self:end;background-color:#ffffff1a;display:block;padding:var(--shape-spacing-xs);width:-webkit-min-content;width:-moz-min-content;width:min-content}._portal_1j8wd_41 ._toggle_1j8wd_258 [data-component=icon]{background-color:var(--colors-semantic-bg-surface);opacity:1;transform:rotateY(0);transition:transform var(--utils-tokens-transition-duration)}._portal_1j8wd_41 [data-component=branding]{left:50%;position:absolute;top:var(--shape-spacing-xs);transform:translate(-50%)}._portal_1j8wd_41._open_1j8wd_322{--gradient-angle: 180deg;width:calc(var(--utils-tokens-unit) * 30);height:100vh}._portal_1j8wd_41._open_1j8wd_322 ._content_1j8wd_251{margin-top:var(--utils-tokens-unit);max-height:calc(100vh - var(--utils-tokens-unit) * 4);opacity:1;overflow:auto;visibility:visible;transition:opacity 1s,visibility 0s}._portal_1j8wd_41._open_1j8wd_322 ._toggle_1j8wd_258>[data-component=icon]{transform:rotateY(180deg)}}@media (width <= 768px){._portal_1j8wd_41._open_1j8wd_322{width:100vw}}
|
package/dist/assets/index26.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
.
|
|
1
|
+
._aside_19eaa_3 section{padding:var(--utils-tokens-unit) 0}._sidebar_19eaa_9{border-right:var(--scale-1) solid var(--colors-semantic-border-default);height:100vh;overflow:hidden auto;padding:var(--shape-spacing-xl) var(--shape-spacing-md) var(--shape-spacing-xl) var(--shape-spacing-sm)}._sidebar_19eaa_9 header{margin-top:0;margin-bottom:var(--shape-spacing-lg)}._sidebar_19eaa_9 [data-sidebar-toggle]{display:none}@supports (-moz-appearance: none){._sidebar_19eaa_9{scrollbar-color:var(--colors-semantic-border-default) transparent;scrollbar-width:thin}}@supports selector(::-webkit-scrollbar){._sidebar_19eaa_9::-webkit-scrollbar{height:var(--scale-2);width:var(--scale-2)}._sidebar_19eaa_9::-webkit-scrollbar-track{background-color:transparent}._sidebar_19eaa_9::-webkit-scrollbar-thumb{background-color:var(--colors-semantic-border-default);border-radius:var(--scale-4)}}._sticky_19eaa_28{position:-webkit-sticky;position:sticky;top:0}@media (width <= 768px){._sidebar_19eaa_9{background-color:var(--colors-semantic-primary-primary-subtle);height:-webkit-fit-content;height:-moz-fit-content;height:fit-content;overscroll-behavior-y:auto;padding:var(--shape-spacing-md);position:relative;top:0;width:100vw;z-index:2;transition:all var(--utils-tokens-transition-duration) var(--utils-tokens-transition-timing-function)}._sidebar_19eaa_9>nav{display:none}._sidebar_19eaa_9>header{margin-bottom:0}._sidebar_19eaa_9 [data-sidebar-toggle]{position:relative;display:block;float:right;margin-top:var(--shape-spacing-2xs);padding:0}._sidebar_19eaa_9 [data-sidebar-toggle]:after{content:"";position:absolute;inset:var(--utils-tokens-negative-unit)}._sidebar_19eaa_9._open_19eaa_65{background-color:var(--colors-semantic-bg-page);display:block;height:calc(100vh - var(--shape-spacing-3xl))}._sidebar_19eaa_9._open_19eaa_65>header{margin-bottom:var(--shape-spacing-md)}._sidebar_19eaa_9._open_19eaa_65>nav{display:block}}
|
package/dist/assets/index38.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
.
|
|
1
|
+
._dialog_1ojxw_3{max-width:var(--shape-width-max-lg);background-color:var(--colors-semantic-bg-surface);border-radius:var(--shape-border-radius-radius-md);border:none;box-sizing:border-box;box-shadow:var(--shape-box-shadow-sm-position-x) var(--shape-box-shadow-sm-position-y) var(--shape-box-shadow-sm-blur) var(--shape-box-shadow-sm-spread) var(--shape-box-shadow-sm-color);max-height:80vh;max-height:80dvh;overflow:auto;padding:var(--shape-spacing-md) var(--shape-spacing-lg);width:100%}._dialog_1ojxw_3::backdrop{background:var(--colors-box-shadow);-webkit-backdrop-filter:blur(var(--shape-box-shadow-xs-blur));backdrop-filter:blur(var(--shape-box-shadow-xs-blur))}._dialog_1ojxw_3 ._close_1ojxw_24{position:absolute;right:0;top:0;z-index:1}._structured_1ojxw_32{display:grid;grid-template-rows:auto minmax(0,1fr) auto;overflow:hidden;padding:0}._structured_1ojxw_32 ._header_1ojxw_38{align-items:start;display:grid;grid-template-columns:minmax(0,1fr) auto;padding:var(--shape-spacing-md) var(--shape-spacing-lg)}._structured_1ojxw_32 ._header_1ojxw_38>header{margin-block:0}._structured_1ojxw_32 ._content_1ojxw_49{min-height:0;overflow:auto;padding:var(--shape-spacing-md) var(--shape-spacing-lg)}@supports (-moz-appearance: none){._structured_1ojxw_32 ._content_1ojxw_49{scrollbar-color:var(--colors-semantic-border-default) transparent;scrollbar-width:thin}}@supports selector(::-webkit-scrollbar){._structured_1ojxw_32 ._content_1ojxw_49::-webkit-scrollbar{height:var(--scale-2);width:var(--scale-2)}._structured_1ojxw_32 ._content_1ojxw_49::-webkit-scrollbar-track{background-color:transparent}._structured_1ojxw_32 ._content_1ojxw_49::-webkit-scrollbar-thumb{background-color:var(--colors-semantic-border-default);border-radius:var(--scale-4)}}._structured_1ojxw_32 ._controls_1ojxw_57{border-top:var(--shape-border-width-default) solid var(--colors-semantic-border-default);padding:var(--shape-spacing-md) var(--shape-spacing-lg)}._structured_1ojxw_32 ._controls_1ojxw_57>:first-child{margin-top:0}._structured_1ojxw_32 ._close_1ojxw_24{grid-column:2;justify-self:end;position:static}._dialog_1ojxw_3:not([open]){display:none}._dialog_1ojxw_3._fullscreen_1ojxw_77{border-radius:0;height:100vh;height:100dvh;top:0;right:0;bottom:0;left:0;margin:0;max-height:none;max-width:none;padding:0;width:100vw;width:100dvw}._dialog_1ojxw_3._fullscreen_1ojxw_77._structured_1ojxw_32{grid-template-rows:auto minmax(0,1fr) auto;overflow:hidden}._dialog_1ojxw_3._fullscreen_1ojxw_77._structured_1ojxw_32 ._content_1ojxw_49{box-sizing:border-box;height:100%;min-height:0;min-width:0;width:100%}@media (width <= 768px){._dialog_1ojxw_3{border-radius:var(--shape-border-radius-radius-md) var(--shape-border-radius-radius-md) 0 0;margin:auto 0 0;max-width:none}._structured_1ojxw_32 ._controls_1ojxw_57{padding-top:0}}
|
package/dist/assets/index41.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
.
|
|
1
|
+
._field_12mt8_3{min-width:0;width:100%}._editor_12mt8_8{background-color:var(--colors-semantic-bg-surface);border:var(--scale-1) solid var(--colors-semantic-border-default);border-radius:var(--shape-border-radius-radius-md);box-shadow:var(--shape-box-shadow-xs-position-x) var(--shape-box-shadow-xs-position-y) var(--shape-box-shadow-xs-blur) var(--shape-box-shadow-xs-spread) var(--shape-box-shadow-xs-color)}._editor_12mt8_8 [role=textbox]{box-sizing:border-box;border-radius:0 0 var(--shape-border-radius-radius-md) var(--shape-border-radius-radius-md);line-height:1.25;max-height:var(--editor-max-height);min-height:var(--editor-min-height);overflow-y:auto;padding:var(--scale-8) var(--utils-tokens-unit)}._editor_12mt8_8 img{max-width:100%}._invalid_12mt8_31{border-color:var(--colors-semantic-status-error-border);outline:solid var(--scale-1) var(--colors-semantic-status-error-border)}._error_12mt8_35{color:var(--colors-semantic-status-error-content);font-size:var(--typography-font-sizes-body-sm);margin-top:var(--scale-4)}._content_12mt8_41{position:relative}._files_12mt8_45{border-top:var(--scale-1) solid var(--colors-semantic-border-default);display:flex;flex-wrap:wrap;gap:var(--scale-8);padding:var(--scale-8) var(--utils-tokens-unit)}._has-files_12mt8_53 [role=textbox]{border-radius:0}._placeholder_12mt8_57{color:var(--colors-semantic-content-secondary);left:var(--utils-tokens-unit);pointer-events:none;position:absolute;top:var(--scale-8)}._fill_12mt8_65{display:grid;grid-template-rows:minmax(0,1fr) auto;height:100%;min-height:0}._fill-editor_12mt8_72{display:grid;grid-template-rows:auto minmax(0,1fr) auto;height:100%;min-height:0}._fill-editor_12mt8_72 ._content_12mt8_41{min-height:0}._fill-editor_12mt8_72 [role=textbox]{height:100%;max-height:none}._meta_12mt8_88{align-items:center;display:grid;flex-basis:100%;grid-template-columns:1fr auto auto;opacity:0;transition:all var(--utils-tokens-transition-duration) var(--utils-tokens-transition-timing-function)}._meta_12mt8_88._active_12mt8_97{border-top:var(--scale-1) solid var(--colors-semantic-border-default);height:auto;opacity:1}._meta_12mt8_88 input{border-radius:0;width:100%}._submit_12mt8_109{margin-left:auto}._bold_12mt8_113{font-weight:700}._italic_12mt8_117{font-style:italic}._link_12mt8_121{color:var(--colors-semantic-primary-primary);cursor:pointer;text-decoration:underline}._list_12mt8_127,._paragraph_12mt8_128{margin:var(--scale-8) 0}._list_12mt8_127{list-style-type:disc!important}._list_12mt8_127 li{list-style:inherit;margin-left:var(--scale-16);margin-bottom:var(--scale-8)}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require('../../assets/index26.css');const s=require("react/jsx-runtime"),l=require("../../classix-5H4IWnMA.cjs"),_=require("react"),b=require("../button/index.cjs"),f=require("../icon/index.cjs"),p="
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require('../../assets/index26.css');const s=require("react/jsx-runtime"),l=require("../../classix-5H4IWnMA.cjs"),_=require("react"),b=require("../button/index.cjs"),f=require("../icon/index.cjs"),p="_aside_19eaa_3",x="_sidebar_19eaa_9",y="_sticky_19eaa_28",k="_open_19eaa_65",e={aside:p,sidebar:x,sticky:y,open:k},m={default:e.default,sidebar:e.sidebar},g=({children:c,className:n,sticky:d=!1,variant:a="default"})=>{const[t,i]=_.useState(!1);return s.jsxs("aside",{className:l.t(n&&n,t&&e.open,e.aside,d&&e.sticky,m[a]),onClick:u=>{var r;const o=u.target.closest("a[href]");o&&!((r=o.getAttribute("href"))!=null&&r.startsWith("#"))&&i(!1)},"data-component":"aside",children:[a==="sidebar"&&s.jsx(b.Button,{"data-sidebar-toggle":"true",onClick:()=>i(!t),variant:"tertiary",children:s.jsx(f.Icon,{name:t?"x":"menu"})}),c]})};exports.Aside=g;
|
|
2
2
|
//# sourceMappingURL=index.cjs.map
|
|
@@ -1,29 +1,29 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { t as
|
|
3
|
-
import { useState as
|
|
4
|
-
import { Button as
|
|
5
|
-
import { Icon as
|
|
6
|
-
import '../../assets/index26.css';const
|
|
7
|
-
aside:
|
|
8
|
-
sidebar:
|
|
9
|
-
sticky:
|
|
10
|
-
open:
|
|
1
|
+
import { jsxs as l, jsx as n } from "react/jsx-runtime";
|
|
2
|
+
import { t as m } from "../../classix-DG18itHa.js";
|
|
3
|
+
import { useState as p } from "react";
|
|
4
|
+
import { Button as _ } from "../button/index.js";
|
|
5
|
+
import { Icon as u } from "../icon/index.js";
|
|
6
|
+
import '../../assets/index26.css';const b = "_aside_19eaa_3", k = "_sidebar_19eaa_9", y = "_sticky_19eaa_28", h = "_open_19eaa_65", e = {
|
|
7
|
+
aside: b,
|
|
8
|
+
sidebar: k,
|
|
9
|
+
sticky: y,
|
|
10
|
+
open: h
|
|
11
11
|
}, g = {
|
|
12
|
-
default:
|
|
13
|
-
sidebar:
|
|
12
|
+
default: e.default,
|
|
13
|
+
sidebar: e.sidebar
|
|
14
14
|
}, B = ({
|
|
15
15
|
children: d,
|
|
16
16
|
className: s,
|
|
17
17
|
sticky: c = !1,
|
|
18
|
-
variant:
|
|
18
|
+
variant: a = "default"
|
|
19
19
|
}) => {
|
|
20
|
-
const [
|
|
21
|
-
return /* @__PURE__ */
|
|
20
|
+
const [t, i] = p(!1);
|
|
21
|
+
return /* @__PURE__ */ l("aside", { className: m(s && s, t && e.open, e.aside, c && e.sticky, g[a]), onClick: (f) => {
|
|
22
22
|
var r;
|
|
23
|
-
const
|
|
24
|
-
|
|
23
|
+
const o = f.target.closest("a[href]");
|
|
24
|
+
o && !((r = o.getAttribute("href")) != null && r.startsWith("#")) && i(!1);
|
|
25
25
|
}, "data-component": "aside", children: [
|
|
26
|
-
|
|
26
|
+
a === "sidebar" && /* @__PURE__ */ n(_, { "data-sidebar-toggle": "true", onClick: () => i(!t), variant: "tertiary", children: /* @__PURE__ */ n(u, { name: t ? "x" : "menu" }) }),
|
|
27
27
|
d
|
|
28
28
|
] });
|
|
29
29
|
};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require('../../assets/index38.css');const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require('../../assets/index38.css');const e=require("react/jsx-runtime"),p=require("../../classix-5H4IWnMA.cjs"),a=require("react"),h=require("../button/index.cjs"),P=require("../icon/index.cjs"),T="_dialog_1ojxw_3",E="_close_1ojxw_24",F="_structured_1ojxw_32",M="_header_1ojxw_38",S="_content_1ojxw_49",X="_controls_1ojxw_57",Y="_fullscreen_1ojxw_77",s={dialog:T,close:E,structured:F,header:M,content:S,controls:X,fullscreen:Y},w=c=>a.Children.toArray(c).some(o=>a.isValidElement(o)?o.type===h.Button&&o.props.variant==="danger"?!0:w(o.props.children):!1),A=({children:c,className:o,controls:l,fullscreen:f=!1,header:_,onCancel:i,onClick:u,onClose:d,open:n=!1,setOpen:r,...B})=>{const g=a.useRef(null),x=w(l),j=f||_!=null||l!=null;a.useEffect(()=>{const t=g.current;t&&(n&&!t.open?t.showModal():!n&&t.open&&t.close())},[n]);const b=t=>{i==null||i(t),!(t.defaultPrevented||!r)&&(t.preventDefault(),r(!1))},q=t=>{if(u==null||u(t),x||t.defaultPrevented||t.target!==t.currentTarget||!r)return;const{bottom:N,left:R,right:D,top:k}=t.currentTarget.getBoundingClientRect();(t.clientX<R||t.clientX>D||t.clientY<k||t.clientY>N)&&r(!1)},y=t=>{d==null||d(t),n&&(r==null||r(!1))},m=r&&!x?e.jsx(h.Button,{"aria-label":"Close dialog",className:s.close,onClick:()=>r(!1),variant:"simple",children:e.jsx(P.Icon,{name:"x"})}):null;return e.jsx("dialog",{className:p.t(s.dialog,j&&s.structured,f&&s.fullscreen,o),onCancel:b,onClick:q,onClose:y,ref:g,...B,"data-component":"dialog",children:j?e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:s.header,children:[_,m]}),e.jsx("div",{className:s.content,children:c}),l!=null&&e.jsx("div",{className:s.controls,children:l})]}):e.jsxs(e.Fragment,{children:[m,c]})})};exports.Dialog=A;
|
|
2
2
|
//# sourceMappingURL=index.cjs.map
|
|
@@ -1,61 +1,61 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { t as
|
|
3
|
-
import
|
|
4
|
-
import { Button as
|
|
5
|
-
import { Icon as
|
|
6
|
-
import '../../assets/index38.css';const
|
|
7
|
-
dialog:
|
|
8
|
-
close:
|
|
9
|
-
structured:
|
|
10
|
-
header:
|
|
11
|
-
content:
|
|
12
|
-
controls:
|
|
13
|
-
fullscreen:
|
|
14
|
-
},
|
|
15
|
-
children:
|
|
16
|
-
className:
|
|
1
|
+
import { jsx as e, jsxs as u, Fragment as j } from "react/jsx-runtime";
|
|
2
|
+
import { t as T } from "../../classix-DG18itHa.js";
|
|
3
|
+
import w, { useRef as X, useEffect as Y } from "react";
|
|
4
|
+
import { Button as p } from "../button/index.js";
|
|
5
|
+
import { Icon as A } from "../icon/index.js";
|
|
6
|
+
import '../../assets/index38.css';const F = "_dialog_1ojxw_3", I = "_close_1ojxw_24", M = "_structured_1ojxw_32", V = "_header_1ojxw_38", q = "_content_1ojxw_49", z = "_controls_1ojxw_57", G = "_fullscreen_1ojxw_77", l = {
|
|
7
|
+
dialog: F,
|
|
8
|
+
close: I,
|
|
9
|
+
structured: M,
|
|
10
|
+
header: V,
|
|
11
|
+
content: q,
|
|
12
|
+
controls: z,
|
|
13
|
+
fullscreen: G
|
|
14
|
+
}, B = (c) => w.Children.toArray(c).some((o) => w.isValidElement(o) ? o.type === p && o.props.variant === "danger" ? !0 : B(o.props.children) : !1), U = ({
|
|
15
|
+
children: c,
|
|
16
|
+
className: o,
|
|
17
17
|
controls: a,
|
|
18
18
|
fullscreen: f = !1,
|
|
19
19
|
header: _,
|
|
20
|
-
onCancel:
|
|
21
|
-
onClick:
|
|
22
|
-
onClose:
|
|
20
|
+
onCancel: n,
|
|
21
|
+
onClick: i,
|
|
22
|
+
onClose: d,
|
|
23
23
|
open: s = !1,
|
|
24
24
|
setOpen: t,
|
|
25
|
-
...
|
|
25
|
+
...N
|
|
26
26
|
}) => {
|
|
27
|
-
const m =
|
|
28
|
-
|
|
27
|
+
const m = X(null), g = B(a), h = f || _ != null || a != null;
|
|
28
|
+
Y(() => {
|
|
29
29
|
const r = m.current;
|
|
30
30
|
r && (s && !r.open ? r.showModal() : !s && r.open && r.close());
|
|
31
31
|
}, [s]);
|
|
32
32
|
const R = (r) => {
|
|
33
|
-
|
|
33
|
+
n == null || n(r), !(r.defaultPrevented || !t) && (r.preventDefault(), t(!1));
|
|
34
34
|
}, k = (r) => {
|
|
35
|
-
if (
|
|
35
|
+
if (i == null || i(r), g || r.defaultPrevented || r.target !== r.currentTarget || !t) return;
|
|
36
36
|
const {
|
|
37
37
|
bottom: D,
|
|
38
38
|
left: b,
|
|
39
|
-
right:
|
|
40
|
-
top:
|
|
39
|
+
right: E,
|
|
40
|
+
top: P
|
|
41
41
|
} = r.currentTarget.getBoundingClientRect();
|
|
42
|
-
(r.clientX < b || r.clientX >
|
|
42
|
+
(r.clientX < b || r.clientX > E || r.clientY < P || r.clientY > D) && t(!1);
|
|
43
43
|
}, y = (r) => {
|
|
44
|
-
|
|
45
|
-
},
|
|
46
|
-
return /* @__PURE__ */
|
|
47
|
-
/* @__PURE__ */ u("div", { className:
|
|
44
|
+
d == null || d(r), s && (t == null || t(!1));
|
|
45
|
+
}, x = t && !g ? /* @__PURE__ */ e(p, { "aria-label": "Close dialog", className: l.close, onClick: () => t(!1), variant: "simple", children: /* @__PURE__ */ e(A, { name: "x" }) }) : null;
|
|
46
|
+
return /* @__PURE__ */ e("dialog", { className: T(l.dialog, h && l.structured, f && l.fullscreen, o), onCancel: R, onClick: k, onClose: y, ref: m, ...N, "data-component": "dialog", children: h ? /* @__PURE__ */ u(j, { children: [
|
|
47
|
+
/* @__PURE__ */ u("div", { className: l.header, children: [
|
|
48
48
|
_,
|
|
49
|
-
|
|
49
|
+
x
|
|
50
50
|
] }),
|
|
51
|
-
/* @__PURE__ */
|
|
52
|
-
a != null && /* @__PURE__ */
|
|
53
|
-
] }) : /* @__PURE__ */ u(
|
|
54
|
-
|
|
55
|
-
|
|
51
|
+
/* @__PURE__ */ e("div", { className: l.content, children: c }),
|
|
52
|
+
a != null && /* @__PURE__ */ e("div", { className: l.controls, children: a })
|
|
53
|
+
] }) : /* @__PURE__ */ u(j, { children: [
|
|
54
|
+
x,
|
|
55
|
+
c
|
|
56
56
|
] }) });
|
|
57
57
|
};
|
|
58
58
|
export {
|
|
59
|
-
|
|
59
|
+
U as Dialog
|
|
60
60
|
};
|
|
61
61
|
//# sourceMappingURL=index.js.map
|
|
@@ -54,5 +54,5 @@ vulnerable to XSS attacks. Please remove it from \`allowedTags\`.
|
|
|
54
54
|
Or, to disable this warning, add the \`allowVulnerableTags\` option
|
|
55
55
|
and ensure you are accounting for this risk.
|
|
56
56
|
|
|
57
|
-
`)});const o=e.nonTextTags||["script","style","textarea","option"];let a,l;e.allowedAttributes&&(a={},l={},Qt(e.allowedAttributes,function(x,O){a[O]=[];const A=[];x.forEach(function(U){typeof U=="string"&&U.indexOf("*")>=0?A.push(ka(U).replace(/\\\*/g,".*")):a[O].push(U)}),A.length&&(l[O]=new RegExp("^("+A.join("|")+")$"))}));const f={},h={},c={};Qt(e.allowedClasses,function(x,O){if(a&&(et(a,O)||(a[O]=[]),a[O].push("class")),f[O]=x,Array.isArray(x)){const A=[];f[O]=[],c[O]=[],x.forEach(function(U){typeof U=="string"&&U.indexOf("*")>=0?A.push(ka(U).replace(/\\\*/g,".*")):U instanceof RegExp?c[O].push(U):f[O].push(U)}),A.length&&(h[O]=new RegExp("^("+A.join("|")+")$"))}});const d={};let p;Qt(e.transformTags,function(x,O){let A;typeof x=="function"?A=x:typeof x=="string"&&(A=Jn.simpleTransform(x)),O==="*"?p=A:d[O]=A});let m,g,y,b,v,w,C=!1;I();const S=new E1.Parser({onopentag:function(x,O){if(e.onOpenTag&&e.onOpenTag(x,O),e.enforceHtmlBoundary&&x==="html"&&I(),v){w++;return}const A=new i(x,O);g.push(A);let U=!1;const Z=!!A.text;let Y;if(et(d,x)&&(Y=d[x](x,O),A.attribs=O=Y.attribs,Y.text!==void 0&&(A.innerText=Y.text),x!==Y.tagName&&(A.name=x=Y.tagName,b[m]=Y.tagName)),p&&(Y=p(x,O),A.attribs=O=Y.attribs,x!==Y.tagName&&(A.name=x=Y.tagName,b[m]=Y.tagName)),(!s(x)||e.disallowedTagsMode==="recursiveEscape"&&!P1(y)||e.nestingLimit!=null&&m>=e.nestingLimit)&&(U=!0,y[m]=!0,(e.disallowedTagsMode==="discard"||e.disallowedTagsMode==="completelyDiscard")&&o.indexOf(x)!==-1&&(v=!0,w=1)),m++,U){if(e.disallowedTagsMode==="discard"||e.disallowedTagsMode==="completelyDiscard"){if(A.innerText&&!Z){const J=T(A.innerText);e.textFilter?r+=e.textFilter(J,x):r+=J,C=!0}return}u=r,r=""}r+="<"+x,x==="script"&&(e.allowedScriptHostnames||e.allowedScriptDomains)&&(A.innerText=""),U&&(e.disallowedTagsMode==="escape"||e.disallowedTagsMode==="recursiveEscape")&&e.preserveEscapedAttributes?Qt(O,function(J,L){r+=" "+L+'="'+T(J||"",!0)+'"'}):(!a||et(a,x)||a["*"])&&Qt(O,function(J,L){if(!M1.test(L)){delete A.attribs[L];return}if(J===""&&!e.allowedEmptyAttributes.includes(L)&&(e.nonBooleanAttributes.includes(L)||e.nonBooleanAttributes.includes("*"))){delete A.attribs[L];return}let te=!1;if(!a||et(a,x)&&a[x].indexOf(L)!==-1||a["*"]&&a["*"].indexOf(L)!==-1||et(l,x)&&l[x].test(L)||l["*"]&&l["*"].test(L))te=!0;else if(a&&a[x]){for(const W of a[x])if(k1(W)&&W.name&&W.name===L){te=!0;let G="";if(W.multiple===!0){const ue=J.split(" ");for(const se of ue)W.values.indexOf(se)!==-1&&(G===""?G=se:G+=" "+se)}else W.values.indexOf(J)>=0&&(G=J);J=G}}if(te){if(e.allowedSchemesAppliedToAttributes.indexOf(L)!==-1&&P(x,J)){delete A.attribs[L];return}if(x==="script"&&L==="src"){let W=!0;try{const G=$(J);if(e.allowedScriptHostnames||e.allowedScriptDomains){const ue=(e.allowedScriptHostnames||[]).find(function(ae){return ae===G.url.hostname}),se=(e.allowedScriptDomains||[]).find(function(ae){return G.url.hostname===ae||G.url.hostname.endsWith(`.${ae}`)});W=ue||se}}catch{W=!1}if(!W){delete A.attribs[L];return}}if(x==="iframe"&&L==="src"){let W=!0;try{const G=$(J);if(G.isRelativeUrl)W=et(e,"allowIframeRelativeUrls")?e.allowIframeRelativeUrls:!e.allowedIframeHostnames&&!e.allowedIframeDomains;else if(e.allowedIframeHostnames||e.allowedIframeDomains){const ue=(e.allowedIframeHostnames||[]).find(function(ae){return ae===G.url.hostname}),se=(e.allowedIframeDomains||[]).find(function(ae){return G.url.hostname===ae||G.url.hostname.endsWith(`.${ae}`)});W=ue||se}}catch{W=!1}if(!W){delete A.attribs[L];return}}if(L==="srcset")try{let W=N1(J);if(W.forEach(function(G){P("srcset",G.url)&&(G.evil=!0)}),W=Aa(W,function(G){return!G.evil}),W.length)J=D1(Aa(W,function(G){return!G.evil})),A.attribs[L]=J;else{delete A.attribs[L];return}}catch{delete A.attribs[L];return}if(L==="class"){const W=f[x],G=f["*"],ue=h[x],se=c[x],ae=c["*"],qe=h["*"],yn=[ue,qe].concat(se,ae).filter(function(gr){return gr});if(W&&G?J=B(J,Na(W,G),yn):J=B(J,W||G,yn),!J.length){delete A.attribs[L];return}}if(L==="style"){if(e.parseStyleAttributes)try{const W=A1(x+" {"+J+"}",{map:!1}),G=_(W,e.allowedStyles);if(J=E(G),J.length===0){delete A.attribs[L];return}}catch{typeof window<"u"&&console.warn('Failed to parse "'+x+" {"+J+`}", If you're running this in a browser, we recommend to disable style parsing: options.parseStyleAttributes: false, since this only works in a node environment due to a postcss dependency, More info: https://github.com/apostrophecms/sanitize-html/issues/547`),delete A.attribs[L];return}else if(e.allowedStyles)throw new Error("allowedStyles option cannot be used together with parseStyleAttributes: false.")}r+=" "+L,J&&J.length?r+='="'+T(J,!0)+'"':e.allowedEmptyAttributes.includes(L)&&(r+='=""')}else delete A.attribs[L]}),e.selfClosing.indexOf(x)!==-1?r+=" />":(r+=">",A.innerText&&!Z&&!e.textFilter&&(r+=T(A.innerText),C=!0)),U&&(r=u+T(r),u=""),A.openingTagLength=r.length-A.tagPosition},ontext:function(x){if(v)return;const O=g[g.length-1];let A;if(O&&(A=O.tag,x=O.innerText!==void 0?O.innerText:x),e.disallowedTagsMode==="completelyDiscard"&&!s(A))x="";else if((e.disallowedTagsMode==="discard"||e.disallowedTagsMode==="completelyDiscard")&&(A==="script"||A==="style"))r+=x;else if(!C){const U=T(x,!1);e.textFilter?r+=e.textFilter(U,A):r+=U}if(g.length){const U=g[g.length-1];U.text+=x}},onclosetag:function(x,O){if(e.onCloseTag&&e.onCloseTag(x,O),v)if(w--,!w)v=!1;else return;const A=g.pop();if(!A)return;if(A.tag!==x){g.push(A);return}v=e.enforceHtmlBoundary?x==="html":!1,m--;const U=y[m];if(U){if(delete y[m],e.disallowedTagsMode==="discard"||e.disallowedTagsMode==="completelyDiscard"){A.updateParentNodeText();return}u=r,r=""}if(b[m]&&(x=b[m],delete b[m]),e.exclusiveFilter){const Z=e.exclusiveFilter(A);if(Z==="excludeTag"){U&&(r=u,u=""),r=r.substring(0,A.tagPosition)+r.substring(A.tagPosition+A.openingTagLength);return}else if(Z){r=r.substring(0,A.tagPosition);return}}if(A.updateParentNodeMediaChildren(),A.updateParentNodeText(),e.selfClosing.indexOf(x)!==-1||O&&!s(x)&&["escape","recursiveEscape"].indexOf(e.disallowedTagsMode)>=0){U&&(r=u,u="");return}r+="</"+x+">",U&&(r=u+T(r),u=""),C=!1}},e.parser);if(S.write(n),S.end(),e.disallowedTagsMode==="escape"||e.disallowedTagsMode==="recursiveEscape"){const x=S.endIndex;if(x!=null&&x>=0&&x<n.length){const O=n.substring(x);r+=T(O)}else(x==null||x<0)&&n.length>0&&r===""&&(r=T(n))}return r;function I(){r="",m=0,g=[],y={},b={},v=!1,w=0}function T(x,O){return typeof x!="string"&&(x=x+""),e.parser.decodeEntities&&(x=x.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">"),O&&(x=x.replace(/"/g,"""))),x=x.replace(/&(?![a-zA-Z0-9#]{1,20};)/g,"&").replace(/</g,"<").replace(/>/g,">"),O&&(x=x.replace(/"/g,""")),x}function P(x,O){for(O=O.replace(/[\x00-\x20]+/g,"");;){const Z=O.indexOf("<!--");if(Z===-1)break;const Y=O.indexOf("-->",Z+4);if(Y===-1)break;O=O.substring(0,Z)+O.substring(Y+3)}const A=O.match(/^([a-zA-Z][a-zA-Z0-9.\-+]*):/);if(!A)return O.match(/^[/\\]{2}/)?!e.allowProtocolRelative:!1;const U=A[1].toLowerCase();return et(e.allowedSchemesByTag,x)?e.allowedSchemesByTag[x].indexOf(U)===-1:!e.allowedSchemes||e.allowedSchemes.indexOf(U)===-1}function $(x){if(x=x.replace(/^(\w+:)?\s*[\\/]\s*[\\/]/,"$1//"),x.startsWith("relative:"))throw new Error("relative: exploit attempt");let O="relative://relative-site";for(let Z=0;Z<100;Z++)O+=`/${Z}`;const A=new URL(x,O);return{isRelativeUrl:A&&A.hostname==="relative-site"&&A.protocol==="relative:",url:A}}function _(x,O){if(!O)return x;const A=x.nodes[0];let U;return O[A.selector]&&O["*"]?U=Na(O[A.selector],O["*"]):U=O[A.selector]||O["*"],U&&(x.nodes[0].nodes=A.nodes.reduce(N(U),[])),x}function E(x){return x.nodes[0].nodes.reduce(function(O,A){return O.push(`${A.prop}:${A.value}${A.important?" !important":""}`),O},[]).join(";")}function N(x){return function(O,A){return et(x,A.prop)&&x[A.prop].some(function(Z){return Z.test(A.value)})&&O.push(A),O}}function B(x,O,A){return O?(x=x.split(/\s+/),x.filter(function(U){return O.indexOf(U)!==-1||A.some(function(Z){return Z.test(U)})}).join(" ")):x}}const R1={decodeEntities:!0};Jn.defaults={allowedTags:["address","article","aside","footer","header","h1","h2","h3","h4","h5","h6","hgroup","main","nav","section","blockquote","dd","div","dl","dt","figcaption","figure","hr","li","menu","ol","p","pre","ul","a","abbr","b","bdi","bdo","br","cite","code","data","dfn","em","i","kbd","mark","q","rb","rp","rt","rtc","ruby","s","samp","small","span","strong","sub","sup","time","u","var","wbr","caption","col","colgroup","table","tbody","td","tfoot","th","thead","tr"],nonBooleanAttributes:["abbr","accept","accept-charset","accesskey","action","allow","alt","as","autocapitalize","autocomplete","blocking","charset","cite","class","color","cols","colspan","content","contenteditable","coords","crossorigin","data","datetime","decoding","dir","dirname","download","draggable","enctype","enterkeyhint","fetchpriority","for","form","formaction","formenctype","formmethod","formtarget","headers","height","hidden","high","href","hreflang","http-equiv","id","imagesizes","imagesrcset","inputmode","integrity","is","itemid","itemprop","itemref","itemtype","kind","label","lang","list","loading","low","max","maxlength","media","method","min","minlength","name","nonce","optimum","pattern","ping","placeholder","popover","popovertarget","popovertargetaction","poster","preload","referrerpolicy","rel","rows","rowspan","sandbox","scope","shape","size","sizes","slot","span","spellcheck","src","srcdoc","srclang","srcset","start","step","style","tabindex","target","title","translate","type","usemap","value","width","wrap","onauxclick","onafterprint","onbeforematch","onbeforeprint","onbeforeunload","onbeforetoggle","onblur","oncancel","oncanplay","oncanplaythrough","onchange","onclick","onclose","oncontextlost","oncontextmenu","oncontextrestored","oncopy","oncuechange","oncut","ondblclick","ondrag","ondragend","ondragenter","ondragleave","ondragover","ondragstart","ondrop","ondurationchange","onemptied","onended","onerror","onfocus","onformdata","onhashchange","oninput","oninvalid","onkeydown","onkeypress","onkeyup","onlanguagechange","onload","onloadeddata","onloadedmetadata","onloadstart","onmessage","onmessageerror","onmousedown","onmouseenter","onmouseleave","onmousemove","onmouseout","onmouseover","onmouseup","onoffline","ononline","onpagehide","onpageshow","onpaste","onpause","onplay","onplaying","onpopstate","onprogress","onratechange","onreset","onresize","onrejectionhandled","onscroll","onscrollend","onsecuritypolicyviolation","onseeked","onseeking","onselect","onslotchange","onstalled","onstorage","onsubmit","onsuspend","ontimeupdate","ontoggle","onunhandledrejection","onunload","onvolumechange","onwaiting","onwheel"],disallowedTagsMode:"discard",allowedAttributes:{a:["href","name","target"],img:["src","srcset","alt","title","width","height","loading"]},allowedEmptyAttributes:["alt"],selfClosing:["img","br","hr","area","base","basefont","input","link","meta"],allowedSchemes:["http","https","ftp","mailto","tel"],allowedSchemesByTag:{},allowedSchemesAppliedToAttributes:["href","src","cite"],allowProtocolRelative:!0,enforceHtmlBoundary:!1,parseStyleAttributes:!0,preserveEscapedAttributes:!1};Jn.simpleTransform=function(n,e,t){return t=t===void 0?!0:t,e=e||{},function(r,u){let i;if(t)for(i in e)u[i]=e[i];else u=e;return{tagName:n,attribs:u}}};const ui=dh(L1),g0=hn();class pr extends Al{constructor(t,r,u,i,s,o){super(s);Gt(this,"__src");Gt(this,"__alt");Gt(this,"__width");Gt(this,"__height");Gt(this,"__soliboDocumentId");this.__src=t,this.__alt=r,this.__width=u,this.__height=i,this.__soliboDocumentId=o}static getType(){return"image"}static clone(t){return new pr(t.__src,t.__alt,t.__width,t.__height,t.__key,t.__soliboDocumentId)}static importJSON(t){return Gi({alt:t.alt,height:t.height,soliboDocumentId:t.soliboDocumentId,src:t.src,width:t.width})}exportJSON(){return{alt:this.__alt,height:this.__height,...this.__soliboDocumentId?{soliboDocumentId:this.__soliboDocumentId}:void 0,src:this.__src,type:"image",version:1,width:this.__width}}static importDOM(){return{img:t=>({conversion:r=>{if(!(r instanceof HTMLImageElement))return null;const u=r.getAttribute("src")??"";if(!u)return null;const i=r.getAttribute("width"),s=r.getAttribute("height");return{node:Gi({alt:r.getAttribute("alt")??"",height:s?Number(s):void 0,soliboDocumentId:r.getAttribute("data-solibo-document-id")??void 0,src:u,width:i?Number(i):void 0})}},priority:0})}}exportDOM(){const t=document.createElement("img");return t.setAttribute("src",this.__src),this.__soliboDocumentId&&t.setAttribute("data-solibo-document-id",this.__soliboDocumentId),this.__alt&&t.setAttribute("alt",this.__alt),this.__width&&t.setAttribute("width",String(this.__width)),this.__height&&t.setAttribute("height",String(this.__height)),{element:t}}createDOM(){return document.createElement("span")}updateDOM(){return!1}isInline(){return!0}getSrc(){return this.__src}setSrc(t){const r=this.getWritable();return r.__src=t,r}decorate(t){return z.jsx("img",{alt:this.__alt,height:this.__height,"data-solibo-document-id":this.__soliboDocumentId,onClick:r=>{r.preventDefault(),t.dispatchCommand(g0,{key:this.getKey(),src:this.__src})},src:this.__src,width:this.__width})}}function Gi({alt:n="",height:e,soliboDocumentId:t,src:r,width:u}){return new pr(r,n,u,e,void 0,t)}function Oa(n){return n instanceof pr}const B1=/(([^<>()[\]\\.,;:\s@"]+(\.[^<>()[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))/,F1=/((https?:\/\/(www\.)?)|(www\.))[-a-zA-Z0-9@:%._+~#=]{1,256}\.[a-zA-Z0-9()]{1,6}\b([-a-zA-Z0-9()@:%_+.~#?&//=]*)/,j1=[n=>{const e=B1.exec(n);return e!=null&&e.length?{index:e.index,length:e[0].length,text:e[0],url:`mailto:${e[0]}`}:null},n=>{const e=F1.exec(n);return e!=null&&e.length?{index:e.index,length:e[0].length,text:e[0],url:e[0].startsWith("http")?e[0]:`https://${e[0]}`}:null}];function Ki(n){try{const e=new URL(n);return e.protocol==="http:"||e.protocol==="https:"}catch{return!1}}const q1="_field_1dvgh_3",U1="_editor_1dvgh_8",z1="_invalid_1dvgh_35",$1="_error_1dvgh_39",W1="_content_1dvgh_45",H1="_files_1dvgh_49",V1="_placeholder_1dvgh_61",G1="_fill_1dvgh_69",K1="_meta_1dvgh_92",J1="_active_1dvgh_101",X1="_submit_1dvgh_113",Z1="_bold_1dvgh_117",Q1="_italic_1dvgh_121",Y1="_link_1dvgh_125",em="_list_1dvgh_131",tm="_paragraph_1dvgh_132",fe={field:q1,editor:U1,invalid:z1,error:$1,content:W1,files:H1,"has-files":"_has-files_1dvgh_57",placeholder:V1,fill:G1,"fill-editor":"_fill-editor_1dvgh_76",meta:K1,active:J1,submit:X1,bold:Z1,italic:Q1,link:Y1,list:em,paragraph:tm},nm=({disabled:n=!1,onFilesSelected:e,onSubmit:t,submitLabel:r="Submit"})=>{const[u]=Ie(),[i,s]=q.useState(!1),[o,a]=q.useState(!1),[l,f]=q.useState(!1),[h,c]=q.useState(!1),[d,p]=q.useState(!1),[m,g]=q.useState(""),[y,b]=q.useState(null),[v,w]=q.useState(""),C=Ki(v.trim()),S=q.useRef(null),I=q.useRef(null),T=q.useRef(null),P=q.useRef(!1),$=L=>L.preventDefault(),_=q.useCallback(L=>{T.current=D(L)?L.clone():null},[]),E=q.useCallback(L=>{u.update(()=>{T.current&&Ae(T.current),L()}),T.current=null},[u]),N=L=>{P.current=!0,L.preventDefault()},B=()=>{if(P.current){P.current=!1;return}Y()},x=q.useCallback(()=>{a(!1),g(""),b(null)},[]),O=q.useCallback(()=>{c(!1),w("")},[]),A=q.useCallback(L=>{a(!0),g((L==null?void 0:L.src)??""),b((L==null?void 0:L.key)??null),O(),setTimeout(()=>{var te;return(te=S.current)==null?void 0:te.focus()},0)},[O]),U=q.useCallback(L=>{u.getEditorState().read(()=>{_(j())}),c(!0),w(L),x(),setTimeout(()=>{var te;return(te=I.current)==null?void 0:te.focus()},0)},[x,u,_]),Z=q.useCallback(()=>{const L=v.trim();Ki(L)&&(E(()=>{u.dispatchCommand(un,{url:L,target:"_blank"});const te=j();if(!D(te))return;const W=te.getNodes().at(-1)??null,G=(W==null?void 0:W.getParent())??null,ue=Re(W)?W:Re(G)?G:null;if(ue){const se=ue.getLastChild();if(M(se)){const yn=se.getTextContent(),gr=yn.replace(/\s+$/,"");gr!==yn&&se.setTextContent(gr)}const ae=ue.getNextSibling();if(M(ae)&&/^\s/.test(ae.getTextContent())){ae.select(1,1);return}const qe=le(" ");ue.insertAfter(qe),qe.selectEnd()}}),O())},[O,u,v,E]),Y=q.useCallback(()=>{const L=m.trim();if(!L){x();return}u.update(()=>{if(y){const te=he(y);Oa(te)&&te.setSrc(L);return}bs([Gi({src:L})])}),x()},[x,u,y,m]),ft=q.useCallback(()=>{if(!y){x();return}u.update(()=>{const L=he(y);if(Oa(L)){const te=L.getParent();Bt(te)&&te.getChildrenSize()===1?te.remove():L.remove()}}),x()},[x,u,y]),Vt=q.useCallback(()=>{E(()=>{u.dispatchCommand(un,null)}),O()},[O,u,E]),J=q.useCallback(()=>{const L=j();if(!D(L)){if(Ne(L)){const G=L.getNodes(),ue=G[0]??null,se=(ue==null?void 0:ue.getParent())??null;s(G.some(qe=>M(qe)&&qe.hasFormat("bold"))),f(G.some(qe=>M(qe)&&qe.hasFormat("italic"))),p(X(se)||ie(se)||X(ue)||ie(ue));const ae=Re(ue)?ue:Re(se)?se:null;if(ae){c(!0),w(ae.getURL());return}c(!1),w(""),T.current=null;return}s(!1),f(!1),p(!1),c(!1),w(""),T.current=null;return}const[te]=L.getNodes(),W=(te==null?void 0:te.getParent())??null;if(s(L.hasFormat("bold")),f(L.hasFormat("italic")),p(X(W)||ie(W)),Re(W)){c(!0),w(W.getURL()),_(L);return}c(!1),w(""),T.current=null},[_]);return q.useEffect(()=>at(u.registerUpdateListener(({editorState:L})=>{L.read(()=>{J()})}),u.registerCommand(g0,L=>(A(L),!0),nt),u.registerCommand(mu,()=>(u.getEditorState().read(()=>{J()}),!1),nt)),[u,A,J]),z.jsxs(x0.Toolbar,{variant:"editor","data-component":"editortoolbar",children:[z.jsx(Ue.Button,{"aria-label":"Bold","data-active":i,onClick:()=>{u.dispatchCommand(Ge,"bold")},title:"Bold",variant:"tertiary",children:z.jsx(ze.Icon,{name:"bold"})}),z.jsx(Ue.Button,{"aria-label":"Italic","data-active":l,onClick:()=>{u.dispatchCommand(Ge,"italic")},title:"Italic",variant:"tertiary",children:z.jsx(ze.Icon,{name:"italic"})}),z.jsx(Ue.Button,{"aria-label":"List","data-active":d,onClick:()=>{d?u.dispatchCommand(Kl,void 0):u.dispatchCommand(Gl,void 0)},title:"List",variant:"tertiary",children:z.jsx(ze.Icon,{name:"list"})}),z.jsx(Ue.Button,{"aria-label":"Link","data-active":h,onClick:()=>{h?U(v):(u.dispatchCommand(un,{url:"https://"}),U("https://"))},title:"Link",variant:"tertiary",children:z.jsx(ze.Icon,{name:"link"})}),z.jsx(Ue.Button,{"aria-label":"Image","data-active":o,onClick:()=>{o?x():A()},title:"Image",variant:"tertiary",children:z.jsx(ze.Icon,{name:"image"})}),e&&z.jsx(_0.Dropzone,{label:"Upload files",multiple:!0,onChange:L=>{L.target.files&&e(L.target.files)},variant:"minimal"}),t&&z.jsx(Ue.Button,{"aria-label":r,className:fe.submit,disabled:n,onClick:()=>t(),variant:"primary",children:z.jsx(ze.Icon,{name:"arrow-up"})}),z.jsxs("div",{className:Ur.t(fe.meta,h||o?fe.active:""),children:[h&&z.jsxs(z.Fragment,{children:[z.jsx(Ws.Input,{"aria-invalid":!C,onBlur:()=>Z(),onChange:L=>w(L.target.value),onKeyDown:L=>{L.key==="Enter"&&(L.preventDefault(),Z())},ref:I,value:v}),z.jsx(Ue.Button,{"aria-label":"Apply link",disabled:!C,onClick:()=>{Z()},onMouseDown:$,variant:"tertiary",children:z.jsx(ze.Icon,{name:"check"})}),z.jsx(Ue.Button,{"aria-label":"Remove link",onClick:()=>Vt(),onMouseDown:$,variant:"tertiary",children:z.jsx(ze.Icon,{name:"trash",variant:"danger"})})]}),o&&z.jsxs(z.Fragment,{children:[z.jsx(Ws.Input,{className:Ur.t(fe.active),onBlur:B,onChange:L=>g(L.target.value),onKeyDown:L=>{L.key==="Enter"&&(L.preventDefault(),P.current=!0,Y())},ref:S,value:m}),z.jsx(Ue.Button,{"aria-label":"Apply image",onClick:()=>Y(),onMouseDown:N,variant:"tertiary",children:z.jsx(ze.Icon,{name:"check"})}),z.jsx(Ue.Button,{"aria-label":"Remove image",onClick:()=>ft(),onMouseDown:N,variant:"tertiary",children:z.jsx(ze.Icon,{name:"trash",variant:"danger"})})]})]})]})};function rm({content:n="",lastEmittedContentRef:e}){const[t]=Ie();return q.useEffect(()=>{e.current!==n&&t.update(()=>{const u=new DOMParser().parseFromString(n,"text/html"),i=Bl(t,u);ce().clear().select(),bs(i),Ae(null)})},[n,t,e]),null}const um=({autofocus:n=!1,autolink:e=!1,content:t,disabled:r=!1,errorMessage:u,fill:i=!1,files:s,inline:o=!1,invalid:a=!1,maxRows:l=12,minRows:f=1,onChange:h,onFilesChange:c,onSubmit:d,onUpload:p,placeholder:m,required:g=!1,submitLabel:y})=>{const b=q.useId(),v=q.useRef(void 0),[w,C]=q.useState([]),S=s??w,I=_=>{s===void 0&&C(_),c==null||c(_)},T=_=>{if(typeof DataTransfer<"u"){const E=new DataTransfer;return _.forEach(N=>E.items.add(N)),E.files}return Object.assign([..._],{item:E=>_[E]??null})},P=async()=>{try{S.length>0&&await(p==null?void 0:p(T(S))),await(d==null?void 0:d()),S.length>0&&I([])}catch{return}},$={namespace:"Editor",theme:{link:fe.link,list:{ol:fe.list,ul:fe.list},paragraph:fe.paragraph,text:{bold:fe.bold,italic:fe.italic}},onError(_){throw _},nodes:[Iu,sr,gn,or,pr]};return z.jsxs("div",{className:Ur.t(fe.field,i&&fe.fill),"data-component":"editor","data-max-rows":l,"data-min-rows":f,children:[z.jsx("div",{className:Ur.t(fe.editor,i&&fe["fill-editor"],a&&fe.invalid,S.length>0&&fe["has-files"]),style:{"--editor-max-height":`calc(${l*1.25}em + (2 * var(--scale-8)))`,"--editor-min-height":`calc(${f*1.25}em + (2 * var(--scale-8)))`},children:z.jsxs(wd,{initialConfig:$,children:[!o&&z.jsx(nm,{disabled:r,onFilesSelected:p||c?_=>{I([...S,...Array.from(_)])}:void 0,onSubmit:d?()=>void P():void 0,submitLabel:y}),z.jsx("div",{className:fe.content,children:z.jsx(ch,{contentEditable:z.jsx(Ad,{"aria-placeholder":m??"",ariaErrorMessage:a&&u?b:void 0,ariaInvalid:a||void 0,ariaRequired:g||void 0,placeholder:()=>m?z.jsx("div",{className:fe.placeholder,children:m}):null}),ErrorBoundary:Dd})}),S.length>0&&z.jsx("div",{"aria-label":"Files to upload",className:fe.files,role:"region",children:S.map((_,E)=>z.jsx(y0.File,{deleteAccessibleLabel:`Remove ${_.name} from upload queue`,name:_.name,onDelete:()=>I(S.filter((N,B)=>B!==E))},`${_.name}-${_.size}-${_.lastModified}-${E}`))}),n&&z.jsx(dd,{}),e&&z.jsx(xd,{matchers:j1}),z.jsx(Ud,{}),t!==void 0&&z.jsx(rm,{content:t,lastEmittedContentRef:v}),z.jsx(zd,{validateUrl:Ki}),z.jsx($d,{}),h&&z.jsx(Hd,{onChange:(_,E)=>{_.read(()=>{const N=Fl(E,null),B=ui(N,{allowedAttributes:{...ui.defaults.allowedAttributes,img:[...ui.defaults.allowedAttributes.img??[],"data-solibo-document-id"]},allowedTags:["a","b","br","i","img","li","ol","p","ul"]});v.current=B,h(B)})}})]})}),a&&u&&z.jsx("div",{className:fe.error,id:b,children:u})]})};exports.Editor=um;
|
|
57
|
+
`)});const o=e.nonTextTags||["script","style","textarea","option"];let a,l;e.allowedAttributes&&(a={},l={},Qt(e.allowedAttributes,function(x,O){a[O]=[];const A=[];x.forEach(function(U){typeof U=="string"&&U.indexOf("*")>=0?A.push(ka(U).replace(/\\\*/g,".*")):a[O].push(U)}),A.length&&(l[O]=new RegExp("^("+A.join("|")+")$"))}));const f={},h={},c={};Qt(e.allowedClasses,function(x,O){if(a&&(et(a,O)||(a[O]=[]),a[O].push("class")),f[O]=x,Array.isArray(x)){const A=[];f[O]=[],c[O]=[],x.forEach(function(U){typeof U=="string"&&U.indexOf("*")>=0?A.push(ka(U).replace(/\\\*/g,".*")):U instanceof RegExp?c[O].push(U):f[O].push(U)}),A.length&&(h[O]=new RegExp("^("+A.join("|")+")$"))}});const d={};let p;Qt(e.transformTags,function(x,O){let A;typeof x=="function"?A=x:typeof x=="string"&&(A=Jn.simpleTransform(x)),O==="*"?p=A:d[O]=A});let m,g,y,b,v,w,C=!1;I();const S=new E1.Parser({onopentag:function(x,O){if(e.onOpenTag&&e.onOpenTag(x,O),e.enforceHtmlBoundary&&x==="html"&&I(),v){w++;return}const A=new i(x,O);g.push(A);let U=!1;const Z=!!A.text;let Y;if(et(d,x)&&(Y=d[x](x,O),A.attribs=O=Y.attribs,Y.text!==void 0&&(A.innerText=Y.text),x!==Y.tagName&&(A.name=x=Y.tagName,b[m]=Y.tagName)),p&&(Y=p(x,O),A.attribs=O=Y.attribs,x!==Y.tagName&&(A.name=x=Y.tagName,b[m]=Y.tagName)),(!s(x)||e.disallowedTagsMode==="recursiveEscape"&&!P1(y)||e.nestingLimit!=null&&m>=e.nestingLimit)&&(U=!0,y[m]=!0,(e.disallowedTagsMode==="discard"||e.disallowedTagsMode==="completelyDiscard")&&o.indexOf(x)!==-1&&(v=!0,w=1)),m++,U){if(e.disallowedTagsMode==="discard"||e.disallowedTagsMode==="completelyDiscard"){if(A.innerText&&!Z){const J=T(A.innerText);e.textFilter?r+=e.textFilter(J,x):r+=J,C=!0}return}u=r,r=""}r+="<"+x,x==="script"&&(e.allowedScriptHostnames||e.allowedScriptDomains)&&(A.innerText=""),U&&(e.disallowedTagsMode==="escape"||e.disallowedTagsMode==="recursiveEscape")&&e.preserveEscapedAttributes?Qt(O,function(J,L){r+=" "+L+'="'+T(J||"",!0)+'"'}):(!a||et(a,x)||a["*"])&&Qt(O,function(J,L){if(!M1.test(L)){delete A.attribs[L];return}if(J===""&&!e.allowedEmptyAttributes.includes(L)&&(e.nonBooleanAttributes.includes(L)||e.nonBooleanAttributes.includes("*"))){delete A.attribs[L];return}let te=!1;if(!a||et(a,x)&&a[x].indexOf(L)!==-1||a["*"]&&a["*"].indexOf(L)!==-1||et(l,x)&&l[x].test(L)||l["*"]&&l["*"].test(L))te=!0;else if(a&&a[x]){for(const W of a[x])if(k1(W)&&W.name&&W.name===L){te=!0;let G="";if(W.multiple===!0){const ue=J.split(" ");for(const se of ue)W.values.indexOf(se)!==-1&&(G===""?G=se:G+=" "+se)}else W.values.indexOf(J)>=0&&(G=J);J=G}}if(te){if(e.allowedSchemesAppliedToAttributes.indexOf(L)!==-1&&P(x,J)){delete A.attribs[L];return}if(x==="script"&&L==="src"){let W=!0;try{const G=$(J);if(e.allowedScriptHostnames||e.allowedScriptDomains){const ue=(e.allowedScriptHostnames||[]).find(function(ae){return ae===G.url.hostname}),se=(e.allowedScriptDomains||[]).find(function(ae){return G.url.hostname===ae||G.url.hostname.endsWith(`.${ae}`)});W=ue||se}}catch{W=!1}if(!W){delete A.attribs[L];return}}if(x==="iframe"&&L==="src"){let W=!0;try{const G=$(J);if(G.isRelativeUrl)W=et(e,"allowIframeRelativeUrls")?e.allowIframeRelativeUrls:!e.allowedIframeHostnames&&!e.allowedIframeDomains;else if(e.allowedIframeHostnames||e.allowedIframeDomains){const ue=(e.allowedIframeHostnames||[]).find(function(ae){return ae===G.url.hostname}),se=(e.allowedIframeDomains||[]).find(function(ae){return G.url.hostname===ae||G.url.hostname.endsWith(`.${ae}`)});W=ue||se}}catch{W=!1}if(!W){delete A.attribs[L];return}}if(L==="srcset")try{let W=N1(J);if(W.forEach(function(G){P("srcset",G.url)&&(G.evil=!0)}),W=Aa(W,function(G){return!G.evil}),W.length)J=D1(Aa(W,function(G){return!G.evil})),A.attribs[L]=J;else{delete A.attribs[L];return}}catch{delete A.attribs[L];return}if(L==="class"){const W=f[x],G=f["*"],ue=h[x],se=c[x],ae=c["*"],qe=h["*"],yn=[ue,qe].concat(se,ae).filter(function(gr){return gr});if(W&&G?J=B(J,Na(W,G),yn):J=B(J,W||G,yn),!J.length){delete A.attribs[L];return}}if(L==="style"){if(e.parseStyleAttributes)try{const W=A1(x+" {"+J+"}",{map:!1}),G=_(W,e.allowedStyles);if(J=E(G),J.length===0){delete A.attribs[L];return}}catch{typeof window<"u"&&console.warn('Failed to parse "'+x+" {"+J+`}", If you're running this in a browser, we recommend to disable style parsing: options.parseStyleAttributes: false, since this only works in a node environment due to a postcss dependency, More info: https://github.com/apostrophecms/sanitize-html/issues/547`),delete A.attribs[L];return}else if(e.allowedStyles)throw new Error("allowedStyles option cannot be used together with parseStyleAttributes: false.")}r+=" "+L,J&&J.length?r+='="'+T(J,!0)+'"':e.allowedEmptyAttributes.includes(L)&&(r+='=""')}else delete A.attribs[L]}),e.selfClosing.indexOf(x)!==-1?r+=" />":(r+=">",A.innerText&&!Z&&!e.textFilter&&(r+=T(A.innerText),C=!0)),U&&(r=u+T(r),u=""),A.openingTagLength=r.length-A.tagPosition},ontext:function(x){if(v)return;const O=g[g.length-1];let A;if(O&&(A=O.tag,x=O.innerText!==void 0?O.innerText:x),e.disallowedTagsMode==="completelyDiscard"&&!s(A))x="";else if((e.disallowedTagsMode==="discard"||e.disallowedTagsMode==="completelyDiscard")&&(A==="script"||A==="style"))r+=x;else if(!C){const U=T(x,!1);e.textFilter?r+=e.textFilter(U,A):r+=U}if(g.length){const U=g[g.length-1];U.text+=x}},onclosetag:function(x,O){if(e.onCloseTag&&e.onCloseTag(x,O),v)if(w--,!w)v=!1;else return;const A=g.pop();if(!A)return;if(A.tag!==x){g.push(A);return}v=e.enforceHtmlBoundary?x==="html":!1,m--;const U=y[m];if(U){if(delete y[m],e.disallowedTagsMode==="discard"||e.disallowedTagsMode==="completelyDiscard"){A.updateParentNodeText();return}u=r,r=""}if(b[m]&&(x=b[m],delete b[m]),e.exclusiveFilter){const Z=e.exclusiveFilter(A);if(Z==="excludeTag"){U&&(r=u,u=""),r=r.substring(0,A.tagPosition)+r.substring(A.tagPosition+A.openingTagLength);return}else if(Z){r=r.substring(0,A.tagPosition);return}}if(A.updateParentNodeMediaChildren(),A.updateParentNodeText(),e.selfClosing.indexOf(x)!==-1||O&&!s(x)&&["escape","recursiveEscape"].indexOf(e.disallowedTagsMode)>=0){U&&(r=u,u="");return}r+="</"+x+">",U&&(r=u+T(r),u=""),C=!1}},e.parser);if(S.write(n),S.end(),e.disallowedTagsMode==="escape"||e.disallowedTagsMode==="recursiveEscape"){const x=S.endIndex;if(x!=null&&x>=0&&x<n.length){const O=n.substring(x);r+=T(O)}else(x==null||x<0)&&n.length>0&&r===""&&(r=T(n))}return r;function I(){r="",m=0,g=[],y={},b={},v=!1,w=0}function T(x,O){return typeof x!="string"&&(x=x+""),e.parser.decodeEntities&&(x=x.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">"),O&&(x=x.replace(/"/g,"""))),x=x.replace(/&(?![a-zA-Z0-9#]{1,20};)/g,"&").replace(/</g,"<").replace(/>/g,">"),O&&(x=x.replace(/"/g,""")),x}function P(x,O){for(O=O.replace(/[\x00-\x20]+/g,"");;){const Z=O.indexOf("<!--");if(Z===-1)break;const Y=O.indexOf("-->",Z+4);if(Y===-1)break;O=O.substring(0,Z)+O.substring(Y+3)}const A=O.match(/^([a-zA-Z][a-zA-Z0-9.\-+]*):/);if(!A)return O.match(/^[/\\]{2}/)?!e.allowProtocolRelative:!1;const U=A[1].toLowerCase();return et(e.allowedSchemesByTag,x)?e.allowedSchemesByTag[x].indexOf(U)===-1:!e.allowedSchemes||e.allowedSchemes.indexOf(U)===-1}function $(x){if(x=x.replace(/^(\w+:)?\s*[\\/]\s*[\\/]/,"$1//"),x.startsWith("relative:"))throw new Error("relative: exploit attempt");let O="relative://relative-site";for(let Z=0;Z<100;Z++)O+=`/${Z}`;const A=new URL(x,O);return{isRelativeUrl:A&&A.hostname==="relative-site"&&A.protocol==="relative:",url:A}}function _(x,O){if(!O)return x;const A=x.nodes[0];let U;return O[A.selector]&&O["*"]?U=Na(O[A.selector],O["*"]):U=O[A.selector]||O["*"],U&&(x.nodes[0].nodes=A.nodes.reduce(N(U),[])),x}function E(x){return x.nodes[0].nodes.reduce(function(O,A){return O.push(`${A.prop}:${A.value}${A.important?" !important":""}`),O},[]).join(";")}function N(x){return function(O,A){return et(x,A.prop)&&x[A.prop].some(function(Z){return Z.test(A.value)})&&O.push(A),O}}function B(x,O,A){return O?(x=x.split(/\s+/),x.filter(function(U){return O.indexOf(U)!==-1||A.some(function(Z){return Z.test(U)})}).join(" ")):x}}const R1={decodeEntities:!0};Jn.defaults={allowedTags:["address","article","aside","footer","header","h1","h2","h3","h4","h5","h6","hgroup","main","nav","section","blockquote","dd","div","dl","dt","figcaption","figure","hr","li","menu","ol","p","pre","ul","a","abbr","b","bdi","bdo","br","cite","code","data","dfn","em","i","kbd","mark","q","rb","rp","rt","rtc","ruby","s","samp","small","span","strong","sub","sup","time","u","var","wbr","caption","col","colgroup","table","tbody","td","tfoot","th","thead","tr"],nonBooleanAttributes:["abbr","accept","accept-charset","accesskey","action","allow","alt","as","autocapitalize","autocomplete","blocking","charset","cite","class","color","cols","colspan","content","contenteditable","coords","crossorigin","data","datetime","decoding","dir","dirname","download","draggable","enctype","enterkeyhint","fetchpriority","for","form","formaction","formenctype","formmethod","formtarget","headers","height","hidden","high","href","hreflang","http-equiv","id","imagesizes","imagesrcset","inputmode","integrity","is","itemid","itemprop","itemref","itemtype","kind","label","lang","list","loading","low","max","maxlength","media","method","min","minlength","name","nonce","optimum","pattern","ping","placeholder","popover","popovertarget","popovertargetaction","poster","preload","referrerpolicy","rel","rows","rowspan","sandbox","scope","shape","size","sizes","slot","span","spellcheck","src","srcdoc","srclang","srcset","start","step","style","tabindex","target","title","translate","type","usemap","value","width","wrap","onauxclick","onafterprint","onbeforematch","onbeforeprint","onbeforeunload","onbeforetoggle","onblur","oncancel","oncanplay","oncanplaythrough","onchange","onclick","onclose","oncontextlost","oncontextmenu","oncontextrestored","oncopy","oncuechange","oncut","ondblclick","ondrag","ondragend","ondragenter","ondragleave","ondragover","ondragstart","ondrop","ondurationchange","onemptied","onended","onerror","onfocus","onformdata","onhashchange","oninput","oninvalid","onkeydown","onkeypress","onkeyup","onlanguagechange","onload","onloadeddata","onloadedmetadata","onloadstart","onmessage","onmessageerror","onmousedown","onmouseenter","onmouseleave","onmousemove","onmouseout","onmouseover","onmouseup","onoffline","ononline","onpagehide","onpageshow","onpaste","onpause","onplay","onplaying","onpopstate","onprogress","onratechange","onreset","onresize","onrejectionhandled","onscroll","onscrollend","onsecuritypolicyviolation","onseeked","onseeking","onselect","onslotchange","onstalled","onstorage","onsubmit","onsuspend","ontimeupdate","ontoggle","onunhandledrejection","onunload","onvolumechange","onwaiting","onwheel"],disallowedTagsMode:"discard",allowedAttributes:{a:["href","name","target"],img:["src","srcset","alt","title","width","height","loading"]},allowedEmptyAttributes:["alt"],selfClosing:["img","br","hr","area","base","basefont","input","link","meta"],allowedSchemes:["http","https","ftp","mailto","tel"],allowedSchemesByTag:{},allowedSchemesAppliedToAttributes:["href","src","cite"],allowProtocolRelative:!0,enforceHtmlBoundary:!1,parseStyleAttributes:!0,preserveEscapedAttributes:!1};Jn.simpleTransform=function(n,e,t){return t=t===void 0?!0:t,e=e||{},function(r,u){let i;if(t)for(i in e)u[i]=e[i];else u=e;return{tagName:n,attribs:u}}};const ui=dh(L1),g0=hn();class pr extends Al{constructor(t,r,u,i,s,o){super(s);Gt(this,"__src");Gt(this,"__alt");Gt(this,"__width");Gt(this,"__height");Gt(this,"__soliboDocumentId");this.__src=t,this.__alt=r,this.__width=u,this.__height=i,this.__soliboDocumentId=o}static getType(){return"image"}static clone(t){return new pr(t.__src,t.__alt,t.__width,t.__height,t.__key,t.__soliboDocumentId)}static importJSON(t){return Gi({alt:t.alt,height:t.height,soliboDocumentId:t.soliboDocumentId,src:t.src,width:t.width})}exportJSON(){return{alt:this.__alt,height:this.__height,...this.__soliboDocumentId?{soliboDocumentId:this.__soliboDocumentId}:void 0,src:this.__src,type:"image",version:1,width:this.__width}}static importDOM(){return{img:t=>({conversion:r=>{if(!(r instanceof HTMLImageElement))return null;const u=r.getAttribute("src")??"";if(!u)return null;const i=r.getAttribute("width"),s=r.getAttribute("height");return{node:Gi({alt:r.getAttribute("alt")??"",height:s?Number(s):void 0,soliboDocumentId:r.getAttribute("data-solibo-document-id")??void 0,src:u,width:i?Number(i):void 0})}},priority:0})}}exportDOM(){const t=document.createElement("img");return t.setAttribute("src",this.__src),this.__soliboDocumentId&&t.setAttribute("data-solibo-document-id",this.__soliboDocumentId),this.__alt&&t.setAttribute("alt",this.__alt),this.__width&&t.setAttribute("width",String(this.__width)),this.__height&&t.setAttribute("height",String(this.__height)),{element:t}}createDOM(){return document.createElement("span")}updateDOM(){return!1}isInline(){return!0}getSrc(){return this.__src}setSrc(t){const r=this.getWritable();return r.__src=t,r}decorate(t){return z.jsx("img",{alt:this.__alt,height:this.__height,"data-solibo-document-id":this.__soliboDocumentId,onClick:r=>{r.preventDefault(),t.dispatchCommand(g0,{key:this.getKey(),src:this.__src})},src:this.__src,width:this.__width})}}function Gi({alt:n="",height:e,soliboDocumentId:t,src:r,width:u}){return new pr(r,n,u,e,void 0,t)}function Oa(n){return n instanceof pr}const B1=/(([^<>()[\]\\.,;:\s@"]+(\.[^<>()[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))/,F1=/((https?:\/\/(www\.)?)|(www\.))[-a-zA-Z0-9@:%._+~#=]{1,256}\.[a-zA-Z0-9()]{1,6}\b([-a-zA-Z0-9()@:%_+.~#?&//=]*)/,j1=[n=>{const e=B1.exec(n);return e!=null&&e.length?{index:e.index,length:e[0].length,text:e[0],url:`mailto:${e[0]}`}:null},n=>{const e=F1.exec(n);return e!=null&&e.length?{index:e.index,length:e[0].length,text:e[0],url:e[0].startsWith("http")?e[0]:`https://${e[0]}`}:null}];function Ki(n){try{const e=new URL(n);return e.protocol==="http:"||e.protocol==="https:"}catch{return!1}}const q1="_field_12mt8_3",U1="_editor_12mt8_8",z1="_invalid_12mt8_31",$1="_error_12mt8_35",W1="_content_12mt8_41",H1="_files_12mt8_45",V1="_placeholder_12mt8_57",G1="_fill_12mt8_65",K1="_meta_12mt8_88",J1="_active_12mt8_97",X1="_submit_12mt8_109",Z1="_bold_12mt8_113",Q1="_italic_12mt8_117",Y1="_link_12mt8_121",em="_list_12mt8_127",tm="_paragraph_12mt8_128",fe={field:q1,editor:U1,invalid:z1,error:$1,content:W1,files:H1,"has-files":"_has-files_12mt8_53",placeholder:V1,fill:G1,"fill-editor":"_fill-editor_12mt8_72",meta:K1,active:J1,submit:X1,bold:Z1,italic:Q1,link:Y1,list:em,paragraph:tm},nm=({disabled:n=!1,onFilesSelected:e,onSubmit:t,submitLabel:r="Submit"})=>{const[u]=Ie(),[i,s]=q.useState(!1),[o,a]=q.useState(!1),[l,f]=q.useState(!1),[h,c]=q.useState(!1),[d,p]=q.useState(!1),[m,g]=q.useState(""),[y,b]=q.useState(null),[v,w]=q.useState(""),C=Ki(v.trim()),S=q.useRef(null),I=q.useRef(null),T=q.useRef(null),P=q.useRef(!1),$=L=>L.preventDefault(),_=q.useCallback(L=>{T.current=D(L)?L.clone():null},[]),E=q.useCallback(L=>{u.update(()=>{T.current&&Ae(T.current),L()}),T.current=null},[u]),N=L=>{P.current=!0,L.preventDefault()},B=()=>{if(P.current){P.current=!1;return}Y()},x=q.useCallback(()=>{a(!1),g(""),b(null)},[]),O=q.useCallback(()=>{c(!1),w("")},[]),A=q.useCallback(L=>{a(!0),g((L==null?void 0:L.src)??""),b((L==null?void 0:L.key)??null),O(),setTimeout(()=>{var te;return(te=S.current)==null?void 0:te.focus()},0)},[O]),U=q.useCallback(L=>{u.getEditorState().read(()=>{_(j())}),c(!0),w(L),x(),setTimeout(()=>{var te;return(te=I.current)==null?void 0:te.focus()},0)},[x,u,_]),Z=q.useCallback(()=>{const L=v.trim();Ki(L)&&(E(()=>{u.dispatchCommand(un,{url:L,target:"_blank"});const te=j();if(!D(te))return;const W=te.getNodes().at(-1)??null,G=(W==null?void 0:W.getParent())??null,ue=Re(W)?W:Re(G)?G:null;if(ue){const se=ue.getLastChild();if(M(se)){const yn=se.getTextContent(),gr=yn.replace(/\s+$/,"");gr!==yn&&se.setTextContent(gr)}const ae=ue.getNextSibling();if(M(ae)&&/^\s/.test(ae.getTextContent())){ae.select(1,1);return}const qe=le(" ");ue.insertAfter(qe),qe.selectEnd()}}),O())},[O,u,v,E]),Y=q.useCallback(()=>{const L=m.trim();if(!L){x();return}u.update(()=>{if(y){const te=he(y);Oa(te)&&te.setSrc(L);return}bs([Gi({src:L})])}),x()},[x,u,y,m]),ft=q.useCallback(()=>{if(!y){x();return}u.update(()=>{const L=he(y);if(Oa(L)){const te=L.getParent();Bt(te)&&te.getChildrenSize()===1?te.remove():L.remove()}}),x()},[x,u,y]),Vt=q.useCallback(()=>{E(()=>{u.dispatchCommand(un,null)}),O()},[O,u,E]),J=q.useCallback(()=>{const L=j();if(!D(L)){if(Ne(L)){const G=L.getNodes(),ue=G[0]??null,se=(ue==null?void 0:ue.getParent())??null;s(G.some(qe=>M(qe)&&qe.hasFormat("bold"))),f(G.some(qe=>M(qe)&&qe.hasFormat("italic"))),p(X(se)||ie(se)||X(ue)||ie(ue));const ae=Re(ue)?ue:Re(se)?se:null;if(ae){c(!0),w(ae.getURL());return}c(!1),w(""),T.current=null;return}s(!1),f(!1),p(!1),c(!1),w(""),T.current=null;return}const[te]=L.getNodes(),W=(te==null?void 0:te.getParent())??null;if(s(L.hasFormat("bold")),f(L.hasFormat("italic")),p(X(W)||ie(W)),Re(W)){c(!0),w(W.getURL()),_(L);return}c(!1),w(""),T.current=null},[_]);return q.useEffect(()=>at(u.registerUpdateListener(({editorState:L})=>{L.read(()=>{J()})}),u.registerCommand(g0,L=>(A(L),!0),nt),u.registerCommand(mu,()=>(u.getEditorState().read(()=>{J()}),!1),nt)),[u,A,J]),z.jsxs(x0.Toolbar,{variant:"editor","data-component":"editortoolbar",children:[z.jsx(Ue.Button,{"aria-label":"Bold","data-active":i,onClick:()=>{u.dispatchCommand(Ge,"bold")},title:"Bold",variant:"tertiary",children:z.jsx(ze.Icon,{name:"bold"})}),z.jsx(Ue.Button,{"aria-label":"Italic","data-active":l,onClick:()=>{u.dispatchCommand(Ge,"italic")},title:"Italic",variant:"tertiary",children:z.jsx(ze.Icon,{name:"italic"})}),z.jsx(Ue.Button,{"aria-label":"List","data-active":d,onClick:()=>{d?u.dispatchCommand(Kl,void 0):u.dispatchCommand(Gl,void 0)},title:"List",variant:"tertiary",children:z.jsx(ze.Icon,{name:"list"})}),z.jsx(Ue.Button,{"aria-label":"Link","data-active":h,onClick:()=>{h?U(v):(u.dispatchCommand(un,{url:"https://"}),U("https://"))},title:"Link",variant:"tertiary",children:z.jsx(ze.Icon,{name:"link"})}),z.jsx(Ue.Button,{"aria-label":"Image","data-active":o,onClick:()=>{o?x():A()},title:"Image",variant:"tertiary",children:z.jsx(ze.Icon,{name:"image"})}),e&&z.jsx(_0.Dropzone,{label:"Upload files",multiple:!0,onChange:L=>{L.target.files&&e(L.target.files)},variant:"minimal"}),t&&z.jsx(Ue.Button,{"aria-label":r,className:fe.submit,disabled:n,onClick:()=>t(),variant:"primary",children:z.jsx(ze.Icon,{name:"arrow-up"})}),z.jsxs("div",{className:Ur.t(fe.meta,h||o?fe.active:""),children:[h&&z.jsxs(z.Fragment,{children:[z.jsx(Ws.Input,{"aria-invalid":!C,onBlur:()=>Z(),onChange:L=>w(L.target.value),onKeyDown:L=>{L.key==="Enter"&&(L.preventDefault(),Z())},ref:I,value:v}),z.jsx(Ue.Button,{"aria-label":"Apply link",disabled:!C,onClick:()=>{Z()},onMouseDown:$,variant:"tertiary",children:z.jsx(ze.Icon,{name:"check"})}),z.jsx(Ue.Button,{"aria-label":"Remove link",onClick:()=>Vt(),onMouseDown:$,variant:"tertiary",children:z.jsx(ze.Icon,{name:"trash",variant:"danger"})})]}),o&&z.jsxs(z.Fragment,{children:[z.jsx(Ws.Input,{className:Ur.t(fe.active),onBlur:B,onChange:L=>g(L.target.value),onKeyDown:L=>{L.key==="Enter"&&(L.preventDefault(),P.current=!0,Y())},ref:S,value:m}),z.jsx(Ue.Button,{"aria-label":"Apply image",onClick:()=>Y(),onMouseDown:N,variant:"tertiary",children:z.jsx(ze.Icon,{name:"check"})}),z.jsx(Ue.Button,{"aria-label":"Remove image",onClick:()=>ft(),onMouseDown:N,variant:"tertiary",children:z.jsx(ze.Icon,{name:"trash",variant:"danger"})})]})]})]})};function rm({content:n="",lastEmittedContentRef:e}){const[t]=Ie();return q.useEffect(()=>{e.current!==n&&t.update(()=>{const u=new DOMParser().parseFromString(n,"text/html"),i=Bl(t,u);ce().clear().select(),bs(i),Ae(null)})},[n,t,e]),null}const um=({autofocus:n=!1,autolink:e=!1,content:t,disabled:r=!1,errorMessage:u,fill:i=!1,files:s,inline:o=!1,invalid:a=!1,maxRows:l=12,minRows:f=1,onChange:h,onFilesChange:c,onSubmit:d,onUpload:p,placeholder:m,required:g=!1,submitLabel:y})=>{const b=q.useId(),v=q.useRef(void 0),[w,C]=q.useState([]),S=s??w,I=_=>{s===void 0&&C(_),c==null||c(_)},T=_=>{if(typeof DataTransfer<"u"){const E=new DataTransfer;return _.forEach(N=>E.items.add(N)),E.files}return Object.assign([..._],{item:E=>_[E]??null})},P=async()=>{try{S.length>0&&await(p==null?void 0:p(T(S))),await(d==null?void 0:d()),S.length>0&&I([])}catch{return}},$={namespace:"Editor",theme:{link:fe.link,list:{ol:fe.list,ul:fe.list},paragraph:fe.paragraph,text:{bold:fe.bold,italic:fe.italic}},onError(_){throw _},nodes:[Iu,sr,gn,or,pr]};return z.jsxs("div",{className:Ur.t(fe.field,i&&fe.fill),"data-component":"editor","data-max-rows":l,"data-min-rows":f,children:[z.jsx("div",{className:Ur.t(fe.editor,i&&fe["fill-editor"],a&&fe.invalid,S.length>0&&fe["has-files"]),style:{"--editor-max-height":`calc(${l*1.25}em + (2 * var(--scale-8)))`,"--editor-min-height":`calc(${f*1.25}em + (2 * var(--scale-8)))`},children:z.jsxs(wd,{initialConfig:$,children:[!o&&z.jsx(nm,{disabled:r,onFilesSelected:p||c?_=>{I([...S,...Array.from(_)])}:void 0,onSubmit:d?()=>void P():void 0,submitLabel:y}),z.jsx("div",{className:fe.content,children:z.jsx(ch,{contentEditable:z.jsx(Ad,{"aria-placeholder":m??"",ariaErrorMessage:a&&u?b:void 0,ariaInvalid:a||void 0,ariaRequired:g||void 0,placeholder:()=>m?z.jsx("div",{className:fe.placeholder,children:m}):null}),ErrorBoundary:Dd})}),S.length>0&&z.jsx("div",{"aria-label":"Files to upload",className:fe.files,role:"region",children:S.map((_,E)=>z.jsx(y0.File,{deleteAccessibleLabel:`Remove ${_.name} from upload queue`,name:_.name,onDelete:()=>I(S.filter((N,B)=>B!==E))},`${_.name}-${_.size}-${_.lastModified}-${E}`))}),n&&z.jsx(dd,{}),e&&z.jsx(xd,{matchers:j1}),z.jsx(Ud,{}),t!==void 0&&z.jsx(rm,{content:t,lastEmittedContentRef:v}),z.jsx(zd,{validateUrl:Ki}),z.jsx($d,{}),h&&z.jsx(Hd,{onChange:(_,E)=>{_.read(()=>{const N=Fl(E,null),B=ui(N,{allowedAttributes:{...ui.defaults.allowedAttributes,img:[...ui.defaults.allowedAttributes.img??[],"data-solibo-document-id"]},allowedTags:["a","b","br","i","img","li","ol","p","ul"]});v.current=B,h(B)})}})]})}),a&&u&&z.jsx("div",{className:fe.error,id:b,children:u})]})};exports.Editor=um;
|
|
58
58
|
//# sourceMappingURL=index.cjs.map
|