@wp-playground/components 0.9.46 → 1.0.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.
@@ -0,0 +1,4 @@
1
+ import React from 'react';
2
+ export declare function PathPreview({ path }: {
3
+ path: string;
4
+ }): React.JSX.Element;
@@ -0,0 +1,9 @@
1
+ import React from 'react';
2
+ import type { FileNode } from '../FilePickerTree';
3
+ export declare function FilePickerControl({ value, onChange, files, isLoading, error, }: {
4
+ value?: string;
5
+ onChange: (selectedPath: string) => void;
6
+ files?: FileNode[];
7
+ isLoading?: boolean;
8
+ error?: string;
9
+ }): React.JSX.Element;
@@ -0,0 +1,15 @@
1
+ import React from 'react';
2
+ export type FileNode = {
3
+ name: string;
4
+ type: 'file' | 'folder';
5
+ children?: FileNode[];
6
+ };
7
+ export type FilePickerControlProps = {
8
+ files: FileNode[];
9
+ initialPath?: string;
10
+ onSelect?: (path: string) => void;
11
+ isLoading?: boolean;
12
+ error?: string;
13
+ };
14
+ declare const FilePickerTree: React.FC<FilePickerControlProps>;
15
+ export default FilePickerTree;
@@ -0,0 +1,2 @@
1
+ import React from 'react';
2
+ export default function GitBrowserDemo(): React.JSX.Element;
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,7 @@
1
+ export interface PromiseState<T> {
2
+ isLoading: boolean;
3
+ error: Error | null;
4
+ data: T | null;
5
+ isResolved: boolean;
6
+ }
7
+ export declare function usePromise<T>(promise: Promise<T>): PromiseState<T>;
package/icons.d.ts ADDED
@@ -0,0 +1,12 @@
1
+ import React from 'react';
2
+ export declare const playgroundLogo: (props?: React.SVGProps<SVGSVGElement>) => React.JSX.Element;
3
+ export declare const temporaryStorage: (props?: React.SVGProps<SVGSVGElement>) => React.JSX.Element;
4
+ export declare const WordPressIcon: (props?: React.SVGProps<SVGSVGElement>) => React.JSX.Element;
5
+ export declare const folder: React.JSX.Element;
6
+ export declare const file: React.JSX.Element;
7
+ export declare const ClockIcon: (props?: React.SVGProps<SVGSVGElement>) => React.JSX.Element;
8
+ export declare const layout: React.JSX.Element;
9
+ export declare function getLogoDataURL(logo: {
10
+ mime: string;
11
+ data: string;
12
+ }): string;
package/index.cjs CHANGED
@@ -1,32 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const u=require("react"),k=require("@wordpress/components"),X=require("@wordpress/element"),mr=require("clsx");function gr({icon:s,size:v=24,...b},h){return X.cloneElement(s,{width:v,height:v,...b,ref:h})}const yr=X.forwardRef(gr);var se={exports:{}},Y={};/**
2
- * @license React
3
- * react-jsx-runtime.production.min.js
4
- *
5
- * Copyright (c) Facebook, Inc. and its affiliates.
6
- *
7
- * This source code is licensed under the MIT license found in the
8
- * LICENSE file in the root directory of this source tree.
9
- */var Ae;function Er(){if(Ae)return Y;Ae=1;var s=u,v=Symbol.for("react.element"),b=Symbol.for("react.fragment"),h=Object.prototype.hasOwnProperty,w=s.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,T={key:!0,ref:!0,__self:!0,__source:!0};function S(d,i,g){var f,C={},x=null,A=null;g!==void 0&&(x=""+g),i.key!==void 0&&(x=""+i.key),i.ref!==void 0&&(A=i.ref);for(f in i)h.call(i,f)&&!T.hasOwnProperty(f)&&(C[f]=i[f]);if(d&&d.defaultProps)for(f in i=d.defaultProps,i)C[f]===void 0&&(C[f]=i[f]);return{$$typeof:v,type:d,key:x,ref:A,props:C,_owner:w.current}}return Y.Fragment=b,Y.jsx=S,Y.jsxs=S,Y}var V={};/**
10
- * @license React
11
- * react-jsx-runtime.development.js
12
- *
13
- * Copyright (c) Facebook, Inc. and its affiliates.
14
- *
15
- * This source code is licensed under the MIT license found in the
16
- * LICENSE file in the root directory of this source tree.
17
- */var $e;function br(){return $e||($e=1,process.env.NODE_ENV!=="production"&&function(){var s=u,v=Symbol.for("react.element"),b=Symbol.for("react.portal"),h=Symbol.for("react.fragment"),w=Symbol.for("react.strict_mode"),T=Symbol.for("react.profiler"),S=Symbol.for("react.provider"),d=Symbol.for("react.context"),i=Symbol.for("react.forward_ref"),g=Symbol.for("react.suspense"),f=Symbol.for("react.suspense_list"),C=Symbol.for("react.memo"),x=Symbol.for("react.lazy"),A=Symbol.for("react.offscreen"),U=Symbol.iterator,H="@@iterator";function p(e){if(e===null||typeof e!="object")return null;var r=U&&e[U]||e[H];return typeof r=="function"?r:null}var _=s.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function E(e){{for(var r=arguments.length,t=new Array(r>1?r-1:0),n=1;n<r;n++)t[n-1]=arguments[n];G("error",e,t)}}function G(e,r,t){{var n=_.ReactDebugCurrentFrame,l=n.getStackAddendum();l!==""&&(r+="%s",t=t.concat([l]));var c=t.map(function(o){return String(o)});c.unshift("Warning: "+r),Function.prototype.apply.call(console[e],console,c)}}var q=!1,Z=!1,Le=!1,Me=!1,Ye=!1,ce;ce=Symbol.for("react.module.reference");function Ve(e){return!!(typeof e=="string"||typeof e=="function"||e===h||e===T||Ye||e===w||e===g||e===f||Me||e===A||q||Z||Le||typeof e=="object"&&e!==null&&(e.$$typeof===x||e.$$typeof===C||e.$$typeof===S||e.$$typeof===d||e.$$typeof===i||e.$$typeof===ce||e.getModuleId!==void 0))}function Ne(e,r,t){var n=e.displayName;if(n)return n;var l=r.displayName||r.name||"";return l!==""?t+"("+l+")":t}function fe(e){return e.displayName||"Context"}function j(e){if(e==null)return null;if(typeof e.tag=="number"&&E("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case h:return"Fragment";case b:return"Portal";case T:return"Profiler";case w:return"StrictMode";case g:return"Suspense";case f:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case d:var r=e;return fe(r)+".Consumer";case S:var t=e;return fe(t._context)+".Provider";case i:return Ne(e,e.render,"ForwardRef");case C:var n=e.displayName||null;return n!==null?n:j(e.type)||"Memo";case x:{var l=e,c=l._payload,o=l._init;try{return j(o(c))}catch{return null}}}return null}var D=Object.assign,W=0,de,pe,ve,he,me,ge,ye;function Ee(){}Ee.__reactDisabledLog=!0;function Ue(){{if(W===0){de=console.log,pe=console.info,ve=console.warn,he=console.error,me=console.group,ge=console.groupCollapsed,ye=console.groupEnd;var e={configurable:!0,enumerable:!0,value:Ee,writable:!0};Object.defineProperties(console,{info:e,log:e,warn:e,error:e,group:e,groupCollapsed:e,groupEnd:e})}W++}}function Ge(){{if(W--,W===0){var e={configurable:!0,enumerable:!0,writable:!0};Object.defineProperties(console,{log:D({},e,{value:de}),info:D({},e,{value:pe}),warn:D({},e,{value:ve}),error:D({},e,{value:he}),group:D({},e,{value:me}),groupCollapsed:D({},e,{value:ge}),groupEnd:D({},e,{value:ye})})}W<0&&E("disabledDepth fell below zero. This is a bug in React. Please file an issue.")}}var Q=_.ReactCurrentDispatcher,ee;function B(e,r,t){{if(ee===void 0)try{throw Error()}catch(l){var n=l.stack.trim().match(/\n( *(at )?)/);ee=n&&n[1]||""}return`
18
- `+ee+e}}var re=!1,K;{var qe=typeof WeakMap=="function"?WeakMap:Map;K=new qe}function be(e,r){if(!e||re)return"";{var t=K.get(e);if(t!==void 0)return t}var n;re=!0;var l=Error.prepareStackTrace;Error.prepareStackTrace=void 0;var c;c=Q.current,Q.current=null,Ue();try{if(r){var o=function(){throw Error()};if(Object.defineProperty(o.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(o,[])}catch(P){n=P}Reflect.construct(e,[],o)}else{try{o.call()}catch(P){n=P}e.call(o.prototype)}}else{try{throw Error()}catch(P){n=P}e()}}catch(P){if(P&&n&&typeof P.stack=="string"){for(var a=P.stack.split(`
19
- `),R=n.stack.split(`
20
- `),m=a.length-1,y=R.length-1;m>=1&&y>=0&&a[m]!==R[y];)y--;for(;m>=1&&y>=0;m--,y--)if(a[m]!==R[y]){if(m!==1||y!==1)do if(m--,y--,y<0||a[m]!==R[y]){var O=`
21
- `+a[m].replace(" at new "," at ");return e.displayName&&O.includes("<anonymous>")&&(O=O.replace("<anonymous>",e.displayName)),typeof e=="function"&&K.set(e,O),O}while(m>=1&&y>=0);break}}}finally{re=!1,Q.current=c,Ge(),Error.prepareStackTrace=l}var I=e?e.displayName||e.name:"",F=I?B(I):"";return typeof e=="function"&&K.set(e,F),F}function Be(e,r,t){return be(e,!1)}function Ke(e){var r=e.prototype;return!!(r&&r.isReactComponent)}function z(e,r,t){if(e==null)return"";if(typeof e=="function")return be(e,Ke(e));if(typeof e=="string")return B(e);switch(e){case g:return B("Suspense");case f:return B("SuspenseList")}if(typeof e=="object")switch(e.$$typeof){case i:return Be(e.render);case C:return z(e.type,r,t);case x:{var n=e,l=n._payload,c=n._init;try{return z(c(l),r,t)}catch{}}}return""}var L=Object.prototype.hasOwnProperty,_e={},Re=_.ReactDebugCurrentFrame;function J(e){if(e){var r=e._owner,t=z(e.type,e._source,r?r.type:null);Re.setExtraStackFrame(t)}else Re.setExtraStackFrame(null)}function ze(e,r,t,n,l){{var c=Function.call.bind(L);for(var o in e)if(c(e,o)){var a=void 0;try{if(typeof e[o]!="function"){var R=Error((n||"React class")+": "+t+" type `"+o+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof e[o]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw R.name="Invariant Violation",R}a=e[o](r,o,n,t,null,"SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED")}catch(m){a=m}a&&!(a instanceof Error)&&(J(l),E("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).",n||"React class",t,o,typeof a),J(null)),a instanceof Error&&!(a.message in _e)&&(_e[a.message]=!0,J(l),E("Failed %s type: %s",t,a.message),J(null))}}}var Je=Array.isArray;function te(e){return Je(e)}function Xe(e){{var r=typeof Symbol=="function"&&Symbol.toStringTag,t=r&&e[Symbol.toStringTag]||e.constructor.name||"Object";return t}}function He(e){try{return we(e),!1}catch{return!0}}function we(e){return""+e}function Te(e){if(He(e))return E("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.",Xe(e)),we(e)}var M=_.ReactCurrentOwner,Ze={key:!0,ref:!0,__self:!0,__source:!0},Pe,Ce,ne;ne={};function Qe(e){if(L.call(e,"ref")){var r=Object.getOwnPropertyDescriptor(e,"ref").get;if(r&&r.isReactWarning)return!1}return e.ref!==void 0}function er(e){if(L.call(e,"key")){var r=Object.getOwnPropertyDescriptor(e,"key").get;if(r&&r.isReactWarning)return!1}return e.key!==void 0}function rr(e,r){if(typeof e.ref=="string"&&M.current&&r&&M.current.stateNode!==r){var t=j(M.current.type);ne[t]||(E('Component "%s" contains the string ref "%s". Support for string refs will be removed in a future major release. This case cannot be automatically converted to an arrow function. We ask you to manually fix this case by using useRef() or createRef() instead. Learn more about using refs safely here: https://reactjs.org/link/strict-mode-string-ref',j(M.current.type),e.ref),ne[t]=!0)}}function tr(e,r){{var t=function(){Pe||(Pe=!0,E("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)",r))};t.isReactWarning=!0,Object.defineProperty(e,"key",{get:t,configurable:!0})}}function nr(e,r){{var t=function(){Ce||(Ce=!0,E("%s: `ref` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)",r))};t.isReactWarning=!0,Object.defineProperty(e,"ref",{get:t,configurable:!0})}}var ar=function(e,r,t,n,l,c,o){var a={$$typeof:v,type:e,key:r,ref:t,props:o,_owner:c};return a._store={},Object.defineProperty(a._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:!1}),Object.defineProperty(a,"_self",{configurable:!1,enumerable:!1,writable:!1,value:n}),Object.defineProperty(a,"_source",{configurable:!1,enumerable:!1,writable:!1,value:l}),Object.freeze&&(Object.freeze(a.props),Object.freeze(a)),a};function or(e,r,t,n,l){{var c,o={},a=null,R=null;t!==void 0&&(Te(t),a=""+t),er(r)&&(Te(r.key),a=""+r.key),Qe(r)&&(R=r.ref,rr(r,l));for(c in r)L.call(r,c)&&!Ze.hasOwnProperty(c)&&(o[c]=r[c]);if(e&&e.defaultProps){var m=e.defaultProps;for(c in m)o[c]===void 0&&(o[c]=m[c])}if(a||R){var y=typeof e=="function"?e.displayName||e.name||"Unknown":e;a&&tr(o,y),R&&nr(o,y)}return ar(e,a,R,l,n,M.current,o)}}var ae=_.ReactCurrentOwner,Oe=_.ReactDebugCurrentFrame;function $(e){if(e){var r=e._owner,t=z(e.type,e._source,r?r.type:null);Oe.setExtraStackFrame(t)}else Oe.setExtraStackFrame(null)}var oe;oe=!1;function ie(e){return typeof e=="object"&&e!==null&&e.$$typeof===v}function Se(){{if(ae.current){var e=j(ae.current.type);if(e)return`
22
-
23
- Check the render method of \``+e+"`."}return""}}function ir(e){{if(e!==void 0){var r=e.fileName.replace(/^.*[\\\/]/,""),t=e.lineNumber;return`
24
-
25
- Check your code at `+r+":"+t+"."}return""}}var xe={};function lr(e){{var r=Se();if(!r){var t=typeof e=="string"?e:e.displayName||e.name;t&&(r=`
26
-
27
- Check the top-level render call using <`+t+">.")}return r}}function je(e,r){{if(!e._store||e._store.validated||e.key!=null)return;e._store.validated=!0;var t=lr(r);if(xe[t])return;xe[t]=!0;var n="";e&&e._owner&&e._owner!==ae.current&&(n=" It was passed a child from "+j(e._owner.type)+"."),$(e),E('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.',t,n),$(null)}}function ke(e,r){{if(typeof e!="object")return;if(te(e))for(var t=0;t<e.length;t++){var n=e[t];ie(n)&&je(n,r)}else if(ie(e))e._store&&(e._store.validated=!0);else if(e){var l=p(e);if(typeof l=="function"&&l!==e.entries)for(var c=l.call(e),o;!(o=c.next()).done;)ie(o.value)&&je(o.value,r)}}}function sr(e){{var r=e.type;if(r==null||typeof r=="string")return;var t;if(typeof r=="function")t=r.propTypes;else if(typeof r=="object"&&(r.$$typeof===i||r.$$typeof===C))t=r.propTypes;else return;if(t){var n=j(r);ze(t,e.props,"prop",n,e)}else if(r.PropTypes!==void 0&&!oe){oe=!0;var l=j(r);E("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?",l||"Unknown")}typeof r.getDefaultProps=="function"&&!r.getDefaultProps.isReactClassApproved&&E("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.")}}function ur(e){{for(var r=Object.keys(e.props),t=0;t<r.length;t++){var n=r[t];if(n!=="children"&&n!=="key"){$(e),E("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.",n),$(null);break}}e.ref!==null&&($(e),E("Invalid attribute `ref` supplied to `React.Fragment`."),$(null))}}var De={};function Fe(e,r,t,n,l,c){{var o=Ve(e);if(!o){var a="";(e===void 0||typeof e=="object"&&e!==null&&Object.keys(e).length===0)&&(a+=" You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");var R=ir(l);R?a+=R:a+=Se();var m;e===null?m="null":te(e)?m="array":e!==void 0&&e.$$typeof===v?(m="<"+(j(e.type)||"Unknown")+" />",a=" Did you accidentally export a JSX literal instead of a component?"):m=typeof e,E("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s",m,a)}var y=or(e,r,t,l,c);if(y==null)return y;if(o){var O=r.children;if(O!==void 0)if(n)if(te(O)){for(var I=0;I<O.length;I++)ke(O[I],e);Object.freeze&&Object.freeze(O)}else E("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");else ke(O,e)}if(L.call(r,"key")){var F=j(e),P=Object.keys(r).filter(function(hr){return hr!=="key"}),le=P.length>0?"{key: someKey, "+P.join(": ..., ")+": ...}":"{key: someKey}";if(!De[F+le]){var vr=P.length>0?"{"+P.join(": ..., ")+": ...}":"{}";E(`A props object containing a "key" prop is being spread into JSX:
28
- let props = %s;
29
- <%s {...props} />
30
- React keys must be passed directly to JSX without using spread:
31
- let props = %s;
32
- <%s key={someKey} {...props} />`,le,F,vr,F),De[F+le]=!0}}return e===h?ur(y):sr(y),y}}function cr(e,r,t){return Fe(e,r,t,!0)}function fr(e,r,t){return Fe(e,r,t,!1)}var dr=fr,pr=cr;V.Fragment=h,V.jsx=dr,V.jsxs=pr}()),V}process.env.NODE_ENV==="production"?se.exports=Er():se.exports=br();var N=se.exports;const Ie=s=>X.createElement("path",s),ue=X.forwardRef(({className:s,isPressed:v,...b},h)=>{const w={...b,className:mr(s,{"is-pressed":v})||void 0,"aria-hidden":!0,focusable:!1};return N.jsx("svg",{...w,ref:h})});ue.displayName="SVG";const _r=N.jsx(ue,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:N.jsx(Ie,{d:"M17.5 11.6L12 16l-5.5-4.4.9-1.2L12 14l4.5-3.6 1 1.2z"})}),Rr=_r,wr=N.jsx(ue,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:N.jsx(Ie,{d:"M10.6 6L9.4 7l4.6 5-4.6 5 1.2 1 5.4-6z"})}),Tr=wr;const Pr=({files:s,initialState:v={},onMappingChange:b=()=>{}})=>{const[h,w]=u.useState(v),T=(d,i)=>{w(g=>({...g,[d]:{...g[d],...i}}))};u.useEffect(()=>{const d={};Object.keys(h).forEach(i=>{h[i].playgroundPath&&(d[i]=h[i].playgroundPath)}),b(d)},[h]);const S=(d,i="")=>i?`${i}/${d.name}`.replaceAll(/\/+/g,"/"):d.name;return u.createElement(k.__experimentalTreeGrid,{className:"path-mapping-control"},u.createElement(k.__experimentalTreeGridRow,{level:0,positionInSet:0,setSize:1},u.createElement(k.__experimentalTreeGridCell,null,()=>u.createElement(u.Fragment,null,"File/Folder")),u.createElement(k.__experimentalTreeGridCell,null,()=>u.createElement(u.Fragment,null,"Absolute path in Playground"))),s.map((d,i)=>u.createElement(We,{key:d.name,node:d,level:0,position:i+1,setSize:s.length,nodeStates:h,updateNodeState:T,generatePath:S})))},We=({node:s,level:v,position:b,setSize:h,nodeStates:w,updateNodeState:T,generatePath:S,parentPath:d="",parentMapping:i=""})=>{const g=S(s,d),f=w[g]||{isOpen:!1,playgroundPath:"",pathType:""},C=Cr({node:s,nodeState:f,parentMapping:i}),x=()=>{T(g,{isOpen:!f.isOpen})},A=p=>{T(g,{playgroundPath:p})},U=p=>{switch(p){case"plugin":T(g,{pathType:p,playgroundPath:"/wordpress/wp-content/plugins/"+s.name});break;case"theme":T(g,{pathType:p,playgroundPath:"/wordpress/wp-content/themes/"+s.name});break;case"wp-content":T(g,{pathType:p,playgroundPath:"/wordpress/wp-content"});break;default:T(g,{pathType:p,playgroundPath:""});break}},H=p=>{var _,E,G,q;if(p.key==="ArrowLeft")f.isOpen?x():(_=s.children)!=null&&_.length&&((E=document.querySelector(`[data-path="${d}"]`))==null||E.focus()),p.preventDefault(),p.stopPropagation();else if(p.key==="ArrowRight"){if(f.isOpen){if((G=s.children)!=null&&G.length){const Z=S(s.children[0],g);(q=document.querySelector(`[data-path="${Z}"]`))==null||q.focus()}}else x();p.preventDefault(),p.stopPropagation()}};return u.createElement(u.Fragment,null,u.createElement(k.__experimentalTreeGridRow,{level:v,positionInSet:b,setSize:h},u.createElement(k.__experimentalTreeGridCell,null,()=>u.createElement(k.Button,{onClick:x,onKeyDown:H,className:"file-node-button","data-path":g},u.createElement(Or,{node:s,isOpen:s.type==="folder"&&f.isOpen,level:v}))),u.createElement(k.__experimentalTreeGridCell,null,()=>{var p;return u.createElement(u.Fragment,null,!i&&u.createElement(k.SelectControl,{label:"Path",value:f.pathType,onChange:U,options:[{label:"Select a path",value:""},{label:"Plugin",value:"plugin"},{label:"Theme",value:"theme"},{label:"wp-content",value:"wp-content"},{label:"Custom path",value:"custom-path"}]}),(i||f.pathType!=="")&&u.createElement(k.__experimentalInputControl,{disabled:!!i||((p=f.pathType)==null?void 0:p.trim())!==""&&f.pathType!=="custom-path",value:C,onChange:A,onDrag:function(){},onDragEnd:function(){},onDragStart:function(){},onValidate:function(){}}))})),f.isOpen&&s.children&&s.children.map((p,_)=>u.createElement(We,{key:p.name,node:p,level:v+1,position:_+1,setSize:s.children.length,nodeStates:w,updateNodeState:T,generatePath:S,parentPath:g,parentMapping:C})))};function Cr({node:s,nodeState:v,parentMapping:b}){return b?`${b}/${s.name}`.replace(/\/+/g,"/"):v.playgroundPath?v.playgroundPath:""}const Or=({node:s,level:v,isOpen:b})=>{const h=[];for(let w=0;w<v;w++)h.push("&nbsp;&nbsp;&nbsp;&nbsp;");return u.createElement(u.Fragment,null,u.createElement("span",{"aria-hidden":"true",dangerouslySetInnerHTML:{__html:h.join("")}}),s.type==="folder"?u.createElement(yr,{width:16,icon:b?Rr:Tr}):u.createElement("div",{style:{width:16}}," "),s.name)};exports.PathMappingControlDemo=Pr;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react"),l=t=>e.createElement("svg",{width:"32",height:"32",viewBox:"0 0 32 32",fill:"none",xmlns:"http://www.w3.org/2000/svg",...t},e.createElement("rect",{width:"10.4176",height:"10.4176",rx:"3.86258",transform:"matrix(0.829038 -0.559193 0.838671 0.544639 7.45703 24.1775)",stroke:"white",strokeWidth:"0.965644"}),e.createElement("rect",{width:"13.2346",height:"13.2346",rx:"3.86258",transform:"matrix(0.829038 -0.559193 0.838671 0.544639 5.0918 18.9934)",stroke:"white",strokeWidth:"1.44847"}),e.createElement("rect",{width:"17.451",height:"17.451",rx:"3.86258",transform:"matrix(0.829038 -0.559193 0.838671 0.544639 1.55371 11.6099)",stroke:"white",strokeWidth:"1.93129"})),r=t=>e.createElement("svg",{width:"16",height:"17",viewBox:"0 0 16 17",fill:"none",xmlns:"http://www.w3.org/2000/svg",...t},e.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M8 15C4.41015 15 1.5 12.0899 1.5 8.5C1.5 4.91015 4.41015 2 8 2C11.5899 2 14.5 4.91015 14.5 8.5C14.5 12.0899 11.5899 15 8 15ZM0 8.5C0 4.08172 3.58172 0.5 8 0.5C12.4183 0.5 16 4.08172 16 8.5C16 12.9183 12.4183 16.5 8 16.5C3.58172 16.5 0 12.9183 0 8.5ZM9 9.5V4.5H7.5V8H5.5V9.5H9Z",fill:"#949494"})),o=t=>e.createElement("svg",{width:"20",height:"21",viewBox:"0 0 20 21",fill:"none",xmlns:"http://www.w3.org/2000/svg",...t},e.createElement("path",{d:"M20 10.5C20 4.99 15.51 0.5 10 0.5C4.48 0.5 0 4.99 0 10.5C0 16.02 4.48 20.5 10 20.5C15.51 20.5 20 16.02 20 10.5ZM7.78 15.87L4.37 6.72C4.92 6.7 5.54 6.64 5.54 6.64C6.04 6.58 5.98 5.51 5.48 5.53C5.48 5.53 4.03 5.64 3.11 5.64C2.93 5.64 2.74 5.64 2.53 5.63C4.12 3.19 6.87 1.61 10 1.61C12.33 1.61 14.45 2.48 16.05 3.95C15.37 3.84 14.4 4.34 14.4 5.53C14.4 6.27 14.85 6.89 15.3 7.63C15.65 8.24 15.85 8.99 15.85 10.09C15.85 11.58 14.45 15.09 14.45 15.09L11.42 6.72C11.96 6.7 12.24 6.55 12.24 6.55C12.74 6.5 12.68 5.3 12.18 5.33C12.18 5.33 10.74 5.45 9.8 5.45C8.93 5.45 7.47 5.33 7.47 5.33C6.97 5.3 6.91 6.53 7.41 6.55L8.33 6.63L9.59 10.04L7.78 15.87ZM17.41 10.5C17.65 9.86 18.15 8.63 17.84 6.25C18.54 7.54 18.89 8.96 18.89 10.5C18.89 13.79 17.16 16.74 14.49 18.28C15.46 15.69 16.43 13.08 17.41 10.5ZM6.1 18.59C3.12 17.15 1.11 14.03 1.11 10.5C1.11 9.2 1.34 8.02 1.83 6.91C3.25 10.8 4.67 14.7 6.1 18.59ZM10.13 11.96L12.71 18.94C11.85 19.23 10.95 19.39 10 19.39C9.21 19.39 8.43 19.28 7.71 19.06C8.52 16.68 9.33 14.32 10.13 11.96Z",fill:"#ffffff"})),n=e.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"15",height:"14",viewBox:"0 0 15 14",fill:"none"},e.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M7.59196 3.59524L6.77745 1.96623C6.70755 1.82641 6.56464 1.7381 6.40832 1.7381H1.65079C1.42287 1.7381 1.2381 1.92287 1.2381 2.15079V11.8492C1.2381 12.0771 1.42287 12.2619 1.65079 12.2619H13.2063C13.4343 12.2619 13.619 12.0771 13.619 11.8492V4.00794C13.619 3.78001 13.4343 3.59524 13.2063 3.59524H7.59196ZM8.35714 2.35714L7.88484 1.41254C7.60521 0.853274 7.0336 0.5 6.40832 0.5H1.65079C0.739085 0.5 0 1.23909 0 2.15079V11.8492C0 12.7609 0.739085 13.5 1.65079 13.5H13.2063C14.1181 13.5 14.8571 12.7609 14.8571 11.8492V4.00794C14.8571 3.09623 14.1181 2.35714 13.2063 2.35714H8.35714Z"})),i=e.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",fill:"currentColor",className:"bi bi-file-earmark",viewBox:"0 0 16 16"},e.createElement("path",{d:"M14 4.5V14a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V2a2 2 0 0 1 2-2h5.5zm-3 0A1.5 1.5 0 0 1 9.5 3V1H4a1 1 0 0 0-1 1v12a1 1 0 0 0 1 1h8a1 1 0 0 0 1-1V4.5z"})),C=t=>e.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"14",height:"14",viewBox:"0 0 14 14",fill:"none",...t},e.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M7 12.6875C3.85888 12.6875 1.3125 10.1411 1.3125 7C1.3125 3.85888 3.85888 1.3125 7 1.3125C10.1411 1.3125 12.6875 3.85888 12.6875 7C12.6875 10.1411 10.1411 12.6875 7 12.6875ZM0 7C0 3.13401 3.13401 0 7 0C10.866 0 14 3.13401 14 7C14 10.866 10.866 14 7 14C3.13401 14 0 10.866 0 7ZM7.875 7.875V3.5H6.5625V6.5625H4.8125V7.875H7.875Z",fill:"#949494"})),a=e.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"14",height:"14",viewBox:"0 0 14 14",fill:"none"},e.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M12.25 1.3125H1.75C1.50838 1.3125 1.3125 1.50838 1.3125 1.75V4.37495H12.6875V1.75C12.6875 1.50837 12.4916 1.3125 12.25 1.3125ZM12.6875 5.68745H5.25003V12.6875H12.25C12.4916 12.6875 12.6875 12.4916 12.6875 12.25V5.68745ZM3.93753 5.68745H1.3125V12.25C1.3125 12.4916 1.50837 12.6875 1.75 12.6875H3.93753L3.93753 5.68745ZM1.75 0H12.25C13.2165 0 14 0.783502 14 1.75V12.25C14 13.2165 13.2165 14 12.25 14H1.75C0.783502 14 0 13.2165 0 12.25V1.75C0 0.783502 0.783502 0 1.75 0Z",fill:"#949494"}));function h(t){return`data:${t.mime};base64,${t.data}`}exports.ClockIcon=C;exports.WordPressIcon=o;exports.file=i;exports.folder=n;exports.getLogoDataURL=h;exports.layout=a;exports.playgroundLogo=l;exports.temporaryStorage=r;
package/index.d.ts CHANGED
@@ -1,2 +1 @@
1
- import PathMappingControlDemo from './PathMappingControl';
2
- export { PathMappingControlDemo };
1
+ export * from './icons';