@chaibuilder/sdk 2.0.0-beta.6 → 2.0.0-beta.61
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +0 -4
- package/dist/ChaiThemeFn-Cort9tch.js +201 -0
- package/dist/ChaiThemeFn-DQu-2Eh9.cjs +13 -0
- package/dist/CodeEditor-BLTQpTTM.js +67 -0
- package/dist/CodeEditor-CJhjQonw.cjs +1 -0
- package/dist/Topbar-CEyGOl06.js +16 -0
- package/dist/Topbar-pFV2NO8v.cjs +1 -0
- package/dist/{context-menu-0lRey9QY.cjs → context-menu-C_ITMOD1.cjs} +1 -1
- package/dist/{context-menu-I8woggB3.js → context-menu-FCyNTUkl.js} +66 -66
- package/dist/core.cjs +61 -1
- package/dist/core.d.ts +116 -54
- package/dist/core.js +8836 -123
- package/dist/getSplitClasses-DodqA_KW.cjs +1 -0
- package/dist/getSplitClasses-DphwgQiE.js +48 -0
- package/dist/{iconBase-Ief2hJUZ.js → iconBase-DHfFLkem.js} +6 -12
- package/dist/{jsx-runtime-Sp0orL4X.js → jsx-runtime-Drh4NO5G.js} +234 -232
- package/dist/jsx-runtime-qcKc-DpB.cjs +30 -0
- package/dist/mockServiceWorker.js +39 -24
- package/dist/plugin-2xcljWGM.cjs +1 -0
- package/dist/plugin-kUMxtQR5.js +24 -0
- package/dist/render.cjs +2 -2
- package/dist/render.d.ts +35 -16
- package/dist/render.js +146 -136
- package/dist/runtime.cjs +1 -1
- package/dist/runtime.d.ts +0 -1
- package/dist/runtime.js +0 -20
- package/dist/{style.css → sdk.css} +1 -1
- package/dist/tailwind.cjs +1 -1
- package/dist/tailwind.d.ts +31 -26
- package/dist/tailwind.js +8 -10
- package/dist/ui.cjs +1 -1
- package/dist/ui.d.ts +6 -51
- package/dist/ui.js +199 -356
- package/dist/web-blocks.cjs +29 -2
- package/dist/web-blocks.js +1742 -822
- package/package.json +122 -121
- package/dist/CodeEditor-D-BYzobl.js +0 -127
- package/dist/CodeEditor-la8rXIF0.cjs +0 -1
- package/dist/STRINGS-Xxstm-7I.js +0 -7
- package/dist/STRINGS-Yl7cSWDc.cjs +0 -1
- package/dist/Topbar-501zWjpi.cjs +0 -1
- package/dist/Topbar-Npy8Q-99.js +0 -161
- package/dist/controls-lEwMTdPQ.js +0 -234
- package/dist/controls-p9IwFnPx.cjs +0 -1
- package/dist/index-kcfrsdbY.cjs +0 -61
- package/dist/index-pDSQeyx5.js +0 -8544
- package/dist/jsx-runtime-JYMCiFoE.cjs +0 -27
- package/dist/plugin-UiUFs2fK.js +0 -44
- package/dist/plugin-f6SDZ_Or.js +0 -108
- package/dist/plugin-jum1MjXp.cjs +0 -1
- package/dist/plugin-xOpS-UNV.cjs +0 -1
- /package/dist/{iconBase-aZzpqff_.cjs → iconBase-Cn2BsTrq.cjs} +0 -0
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
"use strict";const Pe=require("react");var V={exports:{}},k={};/**
|
|
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 Te;function fr(){if(Te)return k;Te=1;var M=Pe,C=Symbol.for("react.element"),U=Symbol.for("react.fragment"),m=Object.prototype.hasOwnProperty,F=M.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,A={key:!0,ref:!0,__self:!0,__source:!0};function w(y,f,T){var p,E={},_=null,I=null;T!==void 0&&(_=""+T),f.key!==void 0&&(_=""+f.key),f.ref!==void 0&&(I=f.ref);for(p in f)m.call(f,p)&&!A.hasOwnProperty(p)&&(E[p]=f[p]);if(y&&y.defaultProps)for(p in f=y.defaultProps,f)E[p]===void 0&&(E[p]=f[p]);return{$$typeof:C,type:y,key:_,ref:I,props:E,_owner:F.current}}return k.Fragment=U,k.jsx=w,k.jsxs=w,k}var D={};/**
|
|
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 Oe;function cr(){return Oe||(Oe=1,process.env.NODE_ENV!=="production"&&function(){var M=Pe,C=Symbol.for("react.element"),U=Symbol.for("react.portal"),m=Symbol.for("react.fragment"),F=Symbol.for("react.strict_mode"),A=Symbol.for("react.profiler"),w=Symbol.for("react.provider"),y=Symbol.for("react.context"),f=Symbol.for("react.forward_ref"),T=Symbol.for("react.suspense"),p=Symbol.for("react.suspense_list"),E=Symbol.for("react.memo"),_=Symbol.for("react.lazy"),I=Symbol.for("react.offscreen"),H=Symbol.iterator,Ce="@@iterator";function we(e){if(e===null||typeof e!="object")return null;var r=H&&e[H]||e[Ce];return typeof r=="function"?r:null}var O=M.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function c(e){{for(var r=arguments.length,t=new Array(r>1?r-1:0),n=1;n<r;n++)t[n-1]=arguments[n];je("error",e,t)}}function je(e,r,t){{var n=O.ReactDebugCurrentFrame,o=n.getStackAddendum();o!==""&&(r+="%s",t=t.concat([o]));var u=t.map(function(i){return String(i)});u.unshift("Warning: "+r),Function.prototype.apply.call(console[e],console,u)}}var xe=!1,ke=!1,De=!1,Fe=!1,Ae=!1,Z;Z=Symbol.for("react.module.reference");function Ie(e){return!!(typeof e=="string"||typeof e=="function"||e===m||e===A||Ae||e===F||e===T||e===p||Fe||e===I||xe||ke||De||typeof e=="object"&&e!==null&&(e.$$typeof===_||e.$$typeof===E||e.$$typeof===w||e.$$typeof===y||e.$$typeof===f||e.$$typeof===Z||e.getModuleId!==void 0))}function $e(e,r,t){var n=e.displayName;if(n)return n;var o=r.displayName||r.name||"";return o!==""?t+"("+o+")":t}function Q(e){return e.displayName||"Context"}function R(e){if(e==null)return null;if(typeof e.tag=="number"&&c("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 m:return"Fragment";case U:return"Portal";case A:return"Profiler";case F:return"StrictMode";case T:return"Suspense";case p:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case y:var r=e;return Q(r)+".Consumer";case w:var t=e;return Q(t._context)+".Provider";case f:return $e(e,e.render,"ForwardRef");case E:var n=e.displayName||null;return n!==null?n:R(e.type)||"Memo";case _:{var o=e,u=o._payload,i=o._init;try{return R(i(u))}catch{return null}}}return null}var b=Object.assign,j=0,ee,re,te,ne,ae,ie,oe;function ue(){}ue.__reactDisabledLog=!0;function We(){{if(j===0){ee=console.log,re=console.info,te=console.warn,ne=console.error,ae=console.group,ie=console.groupCollapsed,oe=console.groupEnd;var e={configurable:!0,enumerable:!0,value:ue,writable:!0};Object.defineProperties(console,{info:e,log:e,warn:e,error:e,group:e,groupCollapsed:e,groupEnd:e})}j++}}function Ye(){{if(j--,j===0){var e={configurable:!0,enumerable:!0,writable:!0};Object.defineProperties(console,{log:b({},e,{value:ee}),info:b({},e,{value:re}),warn:b({},e,{value:te}),error:b({},e,{value:ne}),group:b({},e,{value:ae}),groupCollapsed:b({},e,{value:ie}),groupEnd:b({},e,{value:oe})})}j<0&&c("disabledDepth fell below zero. This is a bug in React. Please file an issue.")}}var N=O.ReactCurrentDispatcher,J;function $(e,r,t){{if(J===void 0)try{throw Error()}catch(o){var n=o.stack.trim().match(/\n( *(at )?)/);J=n&&n[1]||""}return`
|
|
18
|
+
`+J+e}}var q=!1,W;{var Le=typeof WeakMap=="function"?WeakMap:Map;W=new Le}function se(e,r){if(!e||q)return"";{var t=W.get(e);if(t!==void 0)return t}var n;q=!0;var o=Error.prepareStackTrace;Error.prepareStackTrace=void 0;var u;u=N.current,N.current=null,We();try{if(r){var i=function(){throw Error()};if(Object.defineProperty(i.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(i,[])}catch(d){n=d}Reflect.construct(e,[],i)}else{try{i.call()}catch(d){n=d}e.call(i.prototype)}}else{try{throw Error()}catch(d){n=d}e()}}catch(d){if(d&&n&&typeof d.stack=="string"){for(var a=d.stack.split(`
|
|
19
|
+
`),v=n.stack.split(`
|
|
20
|
+
`),s=a.length-1,l=v.length-1;s>=1&&l>=0&&a[s]!==v[l];)l--;for(;s>=1&&l>=0;s--,l--)if(a[s]!==v[l]){if(s!==1||l!==1)do if(s--,l--,l<0||a[s]!==v[l]){var g=`
|
|
21
|
+
`+a[s].replace(" at new "," at ");return e.displayName&&g.includes("<anonymous>")&&(g=g.replace("<anonymous>",e.displayName)),typeof e=="function"&&W.set(e,g),g}while(s>=1&&l>=0);break}}}finally{q=!1,N.current=u,Ye(),Error.prepareStackTrace=o}var P=e?e.displayName||e.name:"",h=P?$(P):"";return typeof e=="function"&&W.set(e,h),h}function Ve(e,r,t){return se(e,!1)}function Me(e){var r=e.prototype;return!!(r&&r.isReactComponent)}function Y(e,r,t){if(e==null)return"";if(typeof e=="function")return se(e,Me(e));if(typeof e=="string")return $(e);switch(e){case T:return $("Suspense");case p:return $("SuspenseList")}if(typeof e=="object")switch(e.$$typeof){case f:return Ve(e.render);case E:return Y(e.type,r,t);case _:{var n=e,o=n._payload,u=n._init;try{return Y(u(o),r,t)}catch{}}}return""}var x=Object.prototype.hasOwnProperty,le={},fe=O.ReactDebugCurrentFrame;function L(e){if(e){var r=e._owner,t=Y(e.type,e._source,r?r.type:null);fe.setExtraStackFrame(t)}else fe.setExtraStackFrame(null)}function Ue(e,r,t,n,o){{var u=Function.call.bind(x);for(var i in e)if(u(e,i)){var a=void 0;try{if(typeof e[i]!="function"){var v=Error((n||"React class")+": "+t+" type `"+i+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof e[i]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw v.name="Invariant Violation",v}a=e[i](r,i,n,t,null,"SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED")}catch(s){a=s}a&&!(a instanceof Error)&&(L(o),c("%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,i,typeof a),L(null)),a instanceof Error&&!(a.message in le)&&(le[a.message]=!0,L(o),c("Failed %s type: %s",t,a.message),L(null))}}}var Ne=Array.isArray;function B(e){return Ne(e)}function Je(e){{var r=typeof Symbol=="function"&&Symbol.toStringTag,t=r&&e[Symbol.toStringTag]||e.constructor.name||"Object";return t}}function qe(e){try{return ce(e),!1}catch{return!0}}function ce(e){return""+e}function ve(e){if(qe(e))return c("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.",Je(e)),ce(e)}var de=O.ReactCurrentOwner,Be={key:!0,ref:!0,__self:!0,__source:!0},pe,ge;function Ke(e){if(x.call(e,"ref")){var r=Object.getOwnPropertyDescriptor(e,"ref").get;if(r&&r.isReactWarning)return!1}return e.ref!==void 0}function Ge(e){if(x.call(e,"key")){var r=Object.getOwnPropertyDescriptor(e,"key").get;if(r&&r.isReactWarning)return!1}return e.key!==void 0}function ze(e,r){typeof e.ref=="string"&&de.current}function Xe(e,r){{var t=function(){pe||(pe=!0,c("%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 He(e,r){{var t=function(){ge||(ge=!0,c("%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 Ze=function(e,r,t,n,o,u,i){var a={$$typeof:C,type:e,key:r,ref:t,props:i,_owner:u};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:o}),Object.freeze&&(Object.freeze(a.props),Object.freeze(a)),a};function Qe(e,r,t,n,o){{var u,i={},a=null,v=null;t!==void 0&&(ve(t),a=""+t),Ge(r)&&(ve(r.key),a=""+r.key),Ke(r)&&(v=r.ref,ze(r,o));for(u in r)x.call(r,u)&&!Be.hasOwnProperty(u)&&(i[u]=r[u]);if(e&&e.defaultProps){var s=e.defaultProps;for(u in s)i[u]===void 0&&(i[u]=s[u])}if(a||v){var l=typeof e=="function"?e.displayName||e.name||"Unknown":e;a&&Xe(i,l),v&&He(i,l)}return Ze(e,a,v,o,n,de.current,i)}}var K=O.ReactCurrentOwner,Ee=O.ReactDebugCurrentFrame;function S(e){if(e){var r=e._owner,t=Y(e.type,e._source,r?r.type:null);Ee.setExtraStackFrame(t)}else Ee.setExtraStackFrame(null)}var G;G=!1;function z(e){return typeof e=="object"&&e!==null&&e.$$typeof===C}function Re(){{if(K.current){var e=R(K.current.type);if(e)return`
|
|
22
|
+
|
|
23
|
+
Check the render method of \``+e+"`."}return""}}function er(e){return""}var ye={};function rr(e){{var r=Re();if(!r){var t=typeof e=="string"?e:e.displayName||e.name;t&&(r=`
|
|
24
|
+
|
|
25
|
+
Check the top-level render call using <`+t+">.")}return r}}function _e(e,r){{if(!e._store||e._store.validated||e.key!=null)return;e._store.validated=!0;var t=rr(r);if(ye[t])return;ye[t]=!0;var n="";e&&e._owner&&e._owner!==K.current&&(n=" It was passed a child from "+R(e._owner.type)+"."),S(e),c('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),S(null)}}function be(e,r){{if(typeof e!="object")return;if(B(e))for(var t=0;t<e.length;t++){var n=e[t];z(n)&&_e(n,r)}else if(z(e))e._store&&(e._store.validated=!0);else if(e){var o=we(e);if(typeof o=="function"&&o!==e.entries)for(var u=o.call(e),i;!(i=u.next()).done;)z(i.value)&&_e(i.value,r)}}}function tr(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===f||r.$$typeof===E))t=r.propTypes;else return;if(t){var n=R(r);Ue(t,e.props,"prop",n,e)}else if(r.PropTypes!==void 0&&!G){G=!0;var o=R(r);c("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?",o||"Unknown")}typeof r.getDefaultProps=="function"&&!r.getDefaultProps.isReactClassApproved&&c("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.")}}function nr(e){{for(var r=Object.keys(e.props),t=0;t<r.length;t++){var n=r[t];if(n!=="children"&&n!=="key"){S(e),c("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.",n),S(null);break}}e.ref!==null&&(S(e),c("Invalid attribute `ref` supplied to `React.Fragment`."),S(null))}}var he={};function me(e,r,t,n,o,u){{var i=Ie(e);if(!i){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 v=er();v?a+=v:a+=Re();var s;e===null?s="null":B(e)?s="array":e!==void 0&&e.$$typeof===C?(s="<"+(R(e.type)||"Unknown")+" />",a=" Did you accidentally export a JSX literal instead of a component?"):s=typeof e,c("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s",s,a)}var l=Qe(e,r,t,o,u);if(l==null)return l;if(i){var g=r.children;if(g!==void 0)if(n)if(B(g)){for(var P=0;P<g.length;P++)be(g[P],e);Object.freeze&&Object.freeze(g)}else c("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 be(g,e)}if(x.call(r,"key")){var h=R(e),d=Object.keys(r).filter(function(lr){return lr!=="key"}),X=d.length>0?"{key: someKey, "+d.join(": ..., ")+": ...}":"{key: someKey}";if(!he[h+X]){var sr=d.length>0?"{"+d.join(": ..., ")+": ...}":"{}";c(`A props object containing a "key" prop is being spread into JSX:
|
|
26
|
+
let props = %s;
|
|
27
|
+
<%s {...props} />
|
|
28
|
+
React keys must be passed directly to JSX without using spread:
|
|
29
|
+
let props = %s;
|
|
30
|
+
<%s key={someKey} {...props} />`,X,h,sr,h),he[h+X]=!0}}return e===m?nr(l):tr(l),l}}function ar(e,r,t){return me(e,r,t,!0)}function ir(e,r,t){return me(e,r,t,!1)}var or=ir,ur=ar;D.Fragment=m,D.jsx=or,D.jsxs=ur}()),D}var Se;function vr(){return Se||(Se=1,process.env.NODE_ENV==="production"?V.exports=fr():V.exports=cr()),V.exports}var dr=vr();exports.jsxRuntimeExports=dr;
|
|
@@ -2,13 +2,14 @@
|
|
|
2
2
|
/* tslint:disable */
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
|
-
* Mock Service Worker
|
|
5
|
+
* Mock Service Worker.
|
|
6
6
|
* @see https://github.com/mswjs/msw
|
|
7
7
|
* - Please do NOT modify this file.
|
|
8
8
|
* - Please do NOT serve this file on production.
|
|
9
9
|
*/
|
|
10
10
|
|
|
11
|
-
const
|
|
11
|
+
const PACKAGE_VERSION = '2.7.0'
|
|
12
|
+
const INTEGRITY_CHECKSUM = '00729d72e3b82faf54ca8b9621dbb96f'
|
|
12
13
|
const IS_MOCKED_RESPONSE = Symbol('isMockedResponse')
|
|
13
14
|
const activeClientIds = new Set()
|
|
14
15
|
|
|
@@ -48,7 +49,10 @@ self.addEventListener('message', async function (event) {
|
|
|
48
49
|
case 'INTEGRITY_CHECK_REQUEST': {
|
|
49
50
|
sendToClient(client, {
|
|
50
51
|
type: 'INTEGRITY_CHECK_RESPONSE',
|
|
51
|
-
payload:
|
|
52
|
+
payload: {
|
|
53
|
+
packageVersion: PACKAGE_VERSION,
|
|
54
|
+
checksum: INTEGRITY_CHECKSUM,
|
|
55
|
+
},
|
|
52
56
|
})
|
|
53
57
|
break
|
|
54
58
|
}
|
|
@@ -58,7 +62,12 @@ self.addEventListener('message', async function (event) {
|
|
|
58
62
|
|
|
59
63
|
sendToClient(client, {
|
|
60
64
|
type: 'MOCKING_ENABLED',
|
|
61
|
-
payload:
|
|
65
|
+
payload: {
|
|
66
|
+
client: {
|
|
67
|
+
id: client.id,
|
|
68
|
+
frameType: client.frameType,
|
|
69
|
+
},
|
|
70
|
+
},
|
|
62
71
|
})
|
|
63
72
|
break
|
|
64
73
|
}
|
|
@@ -121,11 +130,6 @@ async function handleRequest(event, requestId) {
|
|
|
121
130
|
if (client && activeClientIds.has(client.id)) {
|
|
122
131
|
;(async function () {
|
|
123
132
|
const responseClone = response.clone()
|
|
124
|
-
// When performing original requests, response body will
|
|
125
|
-
// always be a ReadableStream, even for 204 responses.
|
|
126
|
-
// But when creating a new Response instance on the client,
|
|
127
|
-
// the body for a 204 response must be null.
|
|
128
|
-
const responseBody = response.status === 204 ? null : responseClone.body
|
|
129
133
|
|
|
130
134
|
sendToClient(
|
|
131
135
|
client,
|
|
@@ -137,11 +141,11 @@ async function handleRequest(event, requestId) {
|
|
|
137
141
|
type: responseClone.type,
|
|
138
142
|
status: responseClone.status,
|
|
139
143
|
statusText: responseClone.statusText,
|
|
140
|
-
body:
|
|
144
|
+
body: responseClone.body,
|
|
141
145
|
headers: Object.fromEntries(responseClone.headers.entries()),
|
|
142
146
|
},
|
|
143
147
|
},
|
|
144
|
-
[
|
|
148
|
+
[responseClone.body],
|
|
145
149
|
)
|
|
146
150
|
})()
|
|
147
151
|
}
|
|
@@ -156,6 +160,10 @@ async function handleRequest(event, requestId) {
|
|
|
156
160
|
async function resolveMainClient(event) {
|
|
157
161
|
const client = await self.clients.get(event.clientId)
|
|
158
162
|
|
|
163
|
+
if (activeClientIds.has(event.clientId)) {
|
|
164
|
+
return client
|
|
165
|
+
}
|
|
166
|
+
|
|
159
167
|
if (client?.frameType === 'top-level') {
|
|
160
168
|
return client
|
|
161
169
|
}
|
|
@@ -184,12 +192,26 @@ async function getResponse(event, client, requestId) {
|
|
|
184
192
|
const requestClone = request.clone()
|
|
185
193
|
|
|
186
194
|
function passthrough() {
|
|
187
|
-
|
|
195
|
+
// Cast the request headers to a new Headers instance
|
|
196
|
+
// so the headers can be manipulated with.
|
|
197
|
+
const headers = new Headers(requestClone.headers)
|
|
198
|
+
|
|
199
|
+
// Remove the "accept" header value that marked this request as passthrough.
|
|
200
|
+
// This prevents request alteration and also keeps it compliant with the
|
|
201
|
+
// user-defined CORS policies.
|
|
202
|
+
const acceptHeader = headers.get('accept')
|
|
203
|
+
if (acceptHeader) {
|
|
204
|
+
const values = acceptHeader.split(',').map((value) => value.trim())
|
|
205
|
+
const filteredValues = values.filter(
|
|
206
|
+
(value) => value !== 'msw/passthrough',
|
|
207
|
+
)
|
|
188
208
|
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
209
|
+
if (filteredValues.length > 0) {
|
|
210
|
+
headers.set('accept', filteredValues.join(', '))
|
|
211
|
+
} else {
|
|
212
|
+
headers.delete('accept')
|
|
213
|
+
}
|
|
214
|
+
}
|
|
193
215
|
|
|
194
216
|
return fetch(requestClone, { headers })
|
|
195
217
|
}
|
|
@@ -207,13 +229,6 @@ async function getResponse(event, client, requestId) {
|
|
|
207
229
|
return passthrough()
|
|
208
230
|
}
|
|
209
231
|
|
|
210
|
-
// Bypass requests with the explicit bypass header.
|
|
211
|
-
// Such requests can be issued by "ctx.fetch()".
|
|
212
|
-
const mswIntention = request.headers.get('x-msw-intention')
|
|
213
|
-
if (['bypass', 'passthrough'].includes(mswIntention)) {
|
|
214
|
-
return passthrough()
|
|
215
|
-
}
|
|
216
|
-
|
|
217
232
|
// Notify the client that a request has been intercepted.
|
|
218
233
|
const requestBuffer = await request.arrayBuffer()
|
|
219
234
|
const clientMessage = await sendToClient(
|
|
@@ -245,7 +260,7 @@ async function getResponse(event, client, requestId) {
|
|
|
245
260
|
return respondWithMock(clientMessage.data)
|
|
246
261
|
}
|
|
247
262
|
|
|
248
|
-
case '
|
|
263
|
+
case 'PASSTHROUGH': {
|
|
249
264
|
return passthrough()
|
|
250
265
|
}
|
|
251
266
|
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";const n=require("./ChaiThemeFn-DQu-2Eh9.cjs"),o=(i=n.defaultThemeOptions)=>({container:{center:!0,padding:"1rem",screens:{"2xl":"1400px"}},...n.getChaiThemeOptions(i)}),r=n.plugin(function({addBase:i,theme:e}){i({"h1,h2,h3,h4,h5,h6":{fontFamily:e("fontFamily.heading")},body:{fontFamily:e("fontFamily.body"),color:e("colors.foreground"),backgroundColor:e("colors.background")}})});exports.chaiBuilderPlugin=r;exports.getChaiBuilderTheme=o;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { g as r, d as a, p as i } from "./ChaiThemeFn-Cort9tch.js";
|
|
2
|
+
const t = (n = a) => ({
|
|
3
|
+
container: {
|
|
4
|
+
center: !0,
|
|
5
|
+
padding: "1rem",
|
|
6
|
+
screens: { "2xl": "1400px" }
|
|
7
|
+
},
|
|
8
|
+
...r(n)
|
|
9
|
+
}), l = i(function({ addBase: n, theme: o }) {
|
|
10
|
+
n({
|
|
11
|
+
"h1,h2,h3,h4,h5,h6": {
|
|
12
|
+
fontFamily: o("fontFamily.heading")
|
|
13
|
+
},
|
|
14
|
+
body: {
|
|
15
|
+
fontFamily: o("fontFamily.body"),
|
|
16
|
+
color: o("colors.foreground"),
|
|
17
|
+
backgroundColor: o("colors.background")
|
|
18
|
+
}
|
|
19
|
+
});
|
|
20
|
+
});
|
|
21
|
+
export {
|
|
22
|
+
l as c,
|
|
23
|
+
t as g
|
|
24
|
+
};
|
package/dist/render.cjs
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const f=require("./ChaiThemeFn-DQu-2Eh9.cjs"),r=require("lodash-es"),h=require("./getSplitClasses-DodqA_KW.cjs"),P=require("@mhsdesign/jit-browser-tailwindcss"),q=require("@tailwindcss/aspect-ratio"),F=require("@tailwindcss/container-queries"),v=require("@tailwindcss/forms"),O=require("@tailwindcss/typography"),C=require("./plugin-2xcljWGM.cjs"),a=require("./jsx-runtime-qcKc-DpB.cjs"),$=require("@chaibuilder/runtime"),p=require("react"),N=require("tailwind-merge"),Y=(e,s="")=>{const{classes:n}=h.getSplitChaiClasses(e),t=n.split(" ").map(i=>i.split(" ").map(l=>{if(l==="")return"";if(l.includes(":")){const u=l.split(":");return u[u.length-1]=s+r.last(u),u.join(":")}return`${s}${l}`}).join(" "));return r.flattenDeep(t).join(" ")},k=e=>{if(!e)return[];try{return JSON.parse(A(e)).filter(n=>!n._type.startsWith("@chai"))}catch{return[{_type:"Paragraph",_id:"error",content:"Invalid JSON. Please check the JSON string."}]}};function A(e){const s=/(asset:\/\/|https:\/\/asset\.localhost\/)(?:localhost\/)?[^"']+/g;return e.replace(s,n=>{const t=decodeURIComponent(n),i=t.indexOf("public");return i!==-1?t.substring(i+6):t})}async function I(e,s,n=[],t="",i){return await P.createTailwindcss({tailwindConfig:{darkMode:"class",safelist:n,theme:{extend:C.getChaiBuilderTheme(e)},plugins:[v,O,q,F,C.chaiBuilderPlugin],corePlugins:{preflight:i},...t?{prefix:`${t}`}:{}}}).generateStylesFromContent(` ${i?"@tailwind base;":""}
|
|
2
2
|
@tailwind components;
|
|
3
|
-
@tailwind utilities;`,
|
|
3
|
+
@tailwind utilities;`,s)}const M=(e,s,n)=>{const t=JSON.stringify(e).replace(/#styles:([^"]*)/g,(i,o)=>`#styles:${o.replace(/,/g," ")}`.replace(/#styles:/g,""));return I(s,[t],[],"",n)},J=async(e,s=f.defaultThemeOptions,n=!1)=>await M(e,s,n);async function K(e){const s=await(e==null?void 0:e.dataProvider(e.block,e.lang,e.metadata));return a.jsxRuntimeExports.jsx(p.Suspense,{children:p.createElement(e.component,{...e.props,...s})})}const L=r.memoize((e,s)=>{const{baseClasses:n,classes:t}=h.getSplitChaiClasses(e),i=N.twMerge(n,t);return s===""?i.replace(h.STYLES_KEY,"").trim():Y(i,s).replace(h.STYLES_KEY,"").trim()});function b(e,s){const n=r.get(e,`${s}_attrs`,{}),t=r.keys(n).join(" ");return r.includes(t,"x-show")&&!r.includes(t,"x-transition")&&(n["x-transition"]=""),n}function U(e,s){const n={};return Object.keys(e).forEach(t=>{if(r.isString(e[t])&&e[t].startsWith(h.STYLES_KEY)){const i=L(e[t],s);n[t]={className:i,...b(e,t)}}}),n}function V(e,s){const n=r.get(e,"_bindings",{});return r.isEmpty(n)?{...e}:(r.each(n,(t,i)=>{r.isString(t)&&r.get(s,t,null)&&(e[i]=r.get(s,t,null))}),e)}function W(e,s,n){if(r.isEmpty(s))return e;const t=r.cloneDeep(e),i=r.get(n,"i18nProps",[]);return r.forEach(r.keys(t),o=>{i.includes(o)&&!r.isEmpty(s)&&(t[o]=r.get(t,`${o}-${s}`,t[o]))}),t}const z=()=>a.jsxRuntimeExports.jsx("span",{children:"Loading..."});function E({blocks:e,parent:s,classPrefix:n="",externalData:t={},blockModifierCallback:i=null,lang:o="",fallbackLang:g="",metadata:l={}}){const u=e,j=c=>U(c,n),T=s?r.filter(e,{_parent:s}):r.filter(e,c=>r.isEmpty(c._parent));return a.jsxRuntimeExports.jsx(a.jsxRuntimeExports.Fragment,{children:p.Children.toArray(T.map((c,w)=>{const S={},B=r.filter(u,{_parent:c._id});S.children=B.length>0?a.jsxRuntimeExports.jsx(E,{externalData:t,classPrefix:n,parent:c._id,blocks:u,lang:o||g,metadata:l}):null;const d=$.getRegisteredChaiBlock(c._type);if(d!==null){let m=c;const x=d.component;m={...d.defaults,...c},i&&(m=i(m));const R=o===g?"":o,y=r.omit({blockProps:{},inBuilder:!1,...m,index:w,...V(W(c,R,d),t),...j(m),...S,metadata:l,lang:o||g},["_parent"]);if(r.has(d,"dataProvider")){const _=r.get(d,"suspenseFallback",z);return a.jsxRuntimeExports.jsx(p.Suspense,{fallback:p.createElement(_),children:a.jsxRuntimeExports.jsx(K,{lang:o||g,metadata:l,dataProvider:d.dataProvider,block:c,component:x,props:y})})}return a.jsxRuntimeExports.jsx(p.Suspense,{children:p.createElement(x,y)})}return a.jsxRuntimeExports.jsxs("noscript",{children:[c._type," not found"]})}))})}exports.getChaiThemeCssVariables=f.getChaiThemeCssVariables;exports.getThemeFontsCSSImport=f.getThemeFontsCSSImport;exports.getThemeFontsLinkMarkup=f.getThemeFontsLinkMarkup;exports.RenderChaiBlocks=E;exports.convertToBlocks=k;exports.getStylesForBlocks=J;
|
package/dist/render.d.ts
CHANGED
|
@@ -1,40 +1,59 @@
|
|
|
1
1
|
import { JSX as JSX_2 } from 'react/jsx-runtime';
|
|
2
2
|
|
|
3
|
-
declare type
|
|
3
|
+
declare type BorderRadiusValue = false | string;
|
|
4
|
+
|
|
5
|
+
declare type ChaiBlock<T = Record<string, any>> = {
|
|
4
6
|
_id: string;
|
|
5
|
-
_type: string;
|
|
6
7
|
_name?: string;
|
|
7
8
|
_parent?: string | null | undefined;
|
|
8
9
|
_bindings?: Record<string, string>;
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
declare type ChaiBuilderTailwindTheme<T extends Record<string, unknown> = Record<string, unknown>> = {
|
|
12
|
-
primaryColor: string;
|
|
13
|
-
secondaryColor: string;
|
|
14
|
-
headingFont: string;
|
|
15
|
-
bodyFont: string;
|
|
16
|
-
roundedCorners: string;
|
|
17
|
-
bodyBgLightColor: string;
|
|
18
|
-
bodyBgDarkColor: string;
|
|
19
|
-
bodyTextLightColor: string;
|
|
20
|
-
bodyTextDarkColor: string;
|
|
10
|
+
_type: string;
|
|
21
11
|
} & T;
|
|
22
12
|
|
|
13
|
+
declare type ChaiBuilderThemeOptions = {
|
|
14
|
+
fontFamily: false | Record<VariableKey, string>;
|
|
15
|
+
borderRadius: BorderRadiusValue;
|
|
16
|
+
colors: false | {
|
|
17
|
+
group: string;
|
|
18
|
+
items: Record<VariableKey, [HSLColor, HSLColor]>;
|
|
19
|
+
}[];
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
declare type ChaiBuilderThemeValues = {
|
|
23
|
+
fontFamily: Record<string, string>;
|
|
24
|
+
borderRadius: string;
|
|
25
|
+
colors: Record<string, string[]>;
|
|
26
|
+
};
|
|
27
|
+
|
|
23
28
|
/**
|
|
24
29
|
* This function converts the chai format content to chai blocks
|
|
25
30
|
* @param chaiFormatContent
|
|
26
31
|
*/
|
|
27
32
|
export declare const convertToBlocks: (chaiFormatContent: string) => ChaiBlock[];
|
|
28
33
|
|
|
29
|
-
export declare const
|
|
34
|
+
export declare const getChaiThemeCssVariables: (chaiTheme: Partial<ChaiBuilderThemeValues>) => string;
|
|
30
35
|
|
|
31
|
-
export declare
|
|
36
|
+
export declare const getStylesForBlocks: (blocks: ChaiBlock[], themeOptions?: ChaiBuilderThemeOptions, includeBaseStyles?: boolean) => Promise<string>;
|
|
37
|
+
|
|
38
|
+
export declare const getThemeFontsCSSImport: (chaiTheme: {
|
|
39
|
+
fontFamily: Record<string, string>;
|
|
40
|
+
}) => any;
|
|
41
|
+
|
|
42
|
+
export declare const getThemeFontsLinkMarkup: (chaiTheme: Pick<Partial<ChaiBuilderThemeValues>, "fontFamily">) => any;
|
|
43
|
+
|
|
44
|
+
declare type HSLColor = string;
|
|
45
|
+
|
|
46
|
+
export declare function RenderChaiBlocks({ blocks, parent, classPrefix, externalData, blockModifierCallback, lang, fallbackLang, metadata, }: {
|
|
32
47
|
blocks: ChaiBlock[];
|
|
33
48
|
parent?: string;
|
|
34
49
|
classPrefix?: string;
|
|
35
50
|
externalData?: Record<string, any>;
|
|
36
51
|
blockModifierCallback?: (block: ChaiBlock) => ChaiBlock;
|
|
37
52
|
lang?: string;
|
|
53
|
+
fallbackLang?: string;
|
|
54
|
+
metadata?: Record<string, any>;
|
|
38
55
|
}): JSX_2.Element;
|
|
39
56
|
|
|
57
|
+
declare type VariableKey = string;
|
|
58
|
+
|
|
40
59
|
export { }
|
package/dist/render.js
CHANGED
|
@@ -1,167 +1,177 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import { j as
|
|
4
|
-
import
|
|
5
|
-
import {
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
import
|
|
9
|
-
import
|
|
10
|
-
import
|
|
11
|
-
import {
|
|
12
|
-
import "
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
if (
|
|
18
|
-
|
|
19
|
-
|
|
1
|
+
import { d as v } from "./ChaiThemeFn-Cort9tch.js";
|
|
2
|
+
import { a as Bt, b as Et, c as $t } from "./ChaiThemeFn-Cort9tch.js";
|
|
3
|
+
import { last as N, flattenDeep as R, memoize as A, filter as g, isEmpty as f, omit as I, has as J, get as p, each as U, isString as j, cloneDeep as K, forEach as M, keys as P, includes as _ } from "lodash-es";
|
|
4
|
+
import { g as T, S as h } from "./getSplitClasses-DphwgQiE.js";
|
|
5
|
+
import { createTailwindcss as W } from "@mhsdesign/jit-browser-tailwindcss";
|
|
6
|
+
import Y from "@tailwindcss/aspect-ratio";
|
|
7
|
+
import b from "@tailwindcss/container-queries";
|
|
8
|
+
import z from "@tailwindcss/forms";
|
|
9
|
+
import D from "@tailwindcss/typography";
|
|
10
|
+
import { g as L, c as Q } from "./plugin-kUMxtQR5.js";
|
|
11
|
+
import { j as a } from "./jsx-runtime-Drh4NO5G.js";
|
|
12
|
+
import { getRegisteredChaiBlock as V } from "@chaibuilder/runtime";
|
|
13
|
+
import S, { Suspense as y, createElement as q } from "react";
|
|
14
|
+
import { twMerge as G } from "tailwind-merge";
|
|
15
|
+
const H = (t, s = "") => {
|
|
16
|
+
const { classes: n } = T(t), e = n.split(" ").map((r) => r.split(" ").map((c) => {
|
|
17
|
+
if (c === "") return "";
|
|
18
|
+
if (c.includes(":")) {
|
|
19
|
+
const l = c.split(":");
|
|
20
|
+
return l[l.length - 1] = s + N(l), l.join(":");
|
|
20
21
|
}
|
|
21
|
-
return `${
|
|
22
|
+
return `${s}${c}`;
|
|
22
23
|
}).join(" "));
|
|
23
|
-
return
|
|
24
|
-
},
|
|
25
|
-
if (!t)
|
|
26
|
-
return [];
|
|
24
|
+
return R(e).join(" ");
|
|
25
|
+
}, _t = (t) => {
|
|
26
|
+
if (!t) return [];
|
|
27
27
|
try {
|
|
28
|
-
return JSON.parse(
|
|
28
|
+
return JSON.parse(X(t)).filter((n) => !n._type.startsWith("@chai"));
|
|
29
29
|
} catch {
|
|
30
30
|
return [{ _type: "Paragraph", _id: "error", content: "Invalid JSON. Please check the JSON string." }];
|
|
31
31
|
}
|
|
32
32
|
};
|
|
33
|
-
function
|
|
34
|
-
const
|
|
35
|
-
return t.replace(
|
|
36
|
-
const
|
|
37
|
-
return
|
|
33
|
+
function X(t) {
|
|
34
|
+
const s = /(asset:\/\/|https:\/\/asset\.localhost\/)(?:localhost\/)?[^"']+/g;
|
|
35
|
+
return t.replace(s, (n) => {
|
|
36
|
+
const e = decodeURIComponent(n), r = e.indexOf("public");
|
|
37
|
+
return r !== -1 ? e.substring(r + 6) : e;
|
|
38
38
|
});
|
|
39
39
|
}
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
40
|
+
async function Z(t, s, n = [], e = "", r) {
|
|
41
|
+
return await W({
|
|
42
|
+
tailwindConfig: {
|
|
43
|
+
darkMode: "class",
|
|
44
|
+
safelist: n,
|
|
45
|
+
theme: { extend: L(t) },
|
|
46
|
+
plugins: [z, D, Y, b, Q],
|
|
47
|
+
corePlugins: { preflight: r },
|
|
48
|
+
...e ? { prefix: `${e}` } : {}
|
|
49
|
+
}
|
|
50
|
+
}).generateStylesFromContent(
|
|
51
|
+
` ${r ? "@tailwind base;" : ""}
|
|
52
|
+
@tailwind components;
|
|
53
|
+
@tailwind utilities;`,
|
|
54
|
+
s
|
|
55
|
+
);
|
|
56
|
+
}
|
|
57
|
+
const k = (t, s, n) => {
|
|
58
|
+
const e = JSON.stringify(t).replace(/#styles:([^"]*)/g, (r, i) => `#styles:${i.replace(/,/g, " ")}`.replace(/#styles:/g, ""));
|
|
59
|
+
return Z(s, [e], [], "", n);
|
|
60
|
+
}, jt = async (t, s = v, n = !1) => await k(t, s, n);
|
|
61
|
+
async function tt(t) {
|
|
62
|
+
const s = await (t == null ? void 0 : t.dataProvider(t.block, t.lang, t.metadata));
|
|
63
|
+
return /* @__PURE__ */ a.jsx(y, { children: S.createElement(t.component, { ...t.props, ...s }) });
|
|
64
|
+
}
|
|
65
|
+
const et = A((t, s) => {
|
|
66
|
+
const { baseClasses: n, classes: e } = T(t), r = G(n, e);
|
|
67
|
+
return s === "" ? r.replace(h, "").trim() : H(r, s).replace(h, "").trim();
|
|
48
68
|
});
|
|
49
|
-
function
|
|
50
|
-
const
|
|
51
|
-
|
|
52
|
-
const s = x(e).join(" ");
|
|
53
|
-
return C(s, "x-show") && !C(s, "x-transition") && (e["x-transition"] = ""), e;
|
|
69
|
+
function st(t, s) {
|
|
70
|
+
const n = p(t, `${s}_attrs`, {}), e = P(n).join(" ");
|
|
71
|
+
return _(e, "x-show") && !_(e, "x-transition") && (n["x-transition"] = ""), n;
|
|
54
72
|
}
|
|
55
|
-
function
|
|
56
|
-
const
|
|
57
|
-
return Object.keys(t).forEach((
|
|
58
|
-
if (j(t[
|
|
59
|
-
const
|
|
60
|
-
e
|
|
61
|
-
className:
|
|
62
|
-
...
|
|
73
|
+
function nt(t, s) {
|
|
74
|
+
const n = {};
|
|
75
|
+
return Object.keys(t).forEach((e) => {
|
|
76
|
+
if (j(t[e]) && t[e].startsWith(h)) {
|
|
77
|
+
const r = et(t[e], s);
|
|
78
|
+
n[e] = {
|
|
79
|
+
className: r,
|
|
80
|
+
...st(t, e)
|
|
63
81
|
};
|
|
64
82
|
}
|
|
65
|
-
}),
|
|
83
|
+
}), n;
|
|
66
84
|
}
|
|
67
|
-
function
|
|
68
|
-
const
|
|
69
|
-
return
|
|
70
|
-
j(
|
|
85
|
+
function rt(t, s) {
|
|
86
|
+
const n = p(t, "_bindings", {});
|
|
87
|
+
return f(n) ? { ...t } : (U(n, (e, r) => {
|
|
88
|
+
j(e) && p(s, e, null) && (t[r] = p(s, e, null));
|
|
71
89
|
}), t);
|
|
72
90
|
}
|
|
73
|
-
function
|
|
74
|
-
if (
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
}), s;
|
|
91
|
+
function it(t, s, n) {
|
|
92
|
+
if (f(s)) return t;
|
|
93
|
+
const e = K(t), r = p(n, "i18nProps", []);
|
|
94
|
+
return M(P(e), (i) => {
|
|
95
|
+
r.includes(i) && !f(s) && (e[i] = p(e, `${i}-${s}`, e[i]));
|
|
96
|
+
}), e;
|
|
80
97
|
}
|
|
81
|
-
|
|
98
|
+
const ot = () => /* @__PURE__ */ a.jsx("span", { children: "Loading..." });
|
|
99
|
+
function at({
|
|
82
100
|
blocks: t,
|
|
83
|
-
parent:
|
|
84
|
-
classPrefix:
|
|
85
|
-
externalData:
|
|
86
|
-
blockModifierCallback:
|
|
87
|
-
lang:
|
|
101
|
+
parent: s,
|
|
102
|
+
classPrefix: n = "",
|
|
103
|
+
externalData: e = {},
|
|
104
|
+
blockModifierCallback: r = null,
|
|
105
|
+
lang: i = "",
|
|
106
|
+
fallbackLang: d = "",
|
|
107
|
+
metadata: c = {}
|
|
88
108
|
}) {
|
|
89
|
-
const
|
|
90
|
-
return /* @__PURE__ */
|
|
91
|
-
|
|
92
|
-
const
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
h[o].map((S) => /* @__PURE__ */ u.jsx(
|
|
96
|
-
E,
|
|
97
|
-
{
|
|
98
|
-
externalData: s,
|
|
99
|
-
classPrefix: e,
|
|
100
|
-
blocks: m,
|
|
101
|
-
parent: S,
|
|
102
|
-
lang: p
|
|
103
|
-
}
|
|
104
|
-
))
|
|
105
|
-
);
|
|
106
|
-
});
|
|
107
|
-
const A = _(m, { _parent: i._id });
|
|
108
|
-
y.children = A.length > 0 ? /* @__PURE__ */ u.jsx(
|
|
109
|
-
E,
|
|
109
|
+
const l = t, B = (o) => nt(o, n), E = s ? g(t, { _parent: s }) : g(t, (o) => f(o._parent));
|
|
110
|
+
return /* @__PURE__ */ a.jsx(a.Fragment, { children: S.Children.toArray(
|
|
111
|
+
E.map((o, $) => {
|
|
112
|
+
const C = {}, F = g(l, { _parent: o._id });
|
|
113
|
+
C.children = F.length > 0 ? /* @__PURE__ */ a.jsx(
|
|
114
|
+
at,
|
|
110
115
|
{
|
|
111
|
-
externalData:
|
|
112
|
-
classPrefix:
|
|
113
|
-
parent:
|
|
114
|
-
blocks:
|
|
115
|
-
lang:
|
|
116
|
+
externalData: e,
|
|
117
|
+
classPrefix: n,
|
|
118
|
+
parent: o._id,
|
|
119
|
+
blocks: l,
|
|
120
|
+
lang: i || d,
|
|
121
|
+
metadata: c
|
|
116
122
|
}
|
|
117
123
|
) : null;
|
|
118
|
-
const
|
|
119
|
-
if (
|
|
120
|
-
let
|
|
121
|
-
const
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
{
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
124
|
+
const u = V(o._type);
|
|
125
|
+
if (u !== null) {
|
|
126
|
+
let m = o;
|
|
127
|
+
const x = u.component;
|
|
128
|
+
m = { ...u.defaults, ...o }, r && (m = r(m));
|
|
129
|
+
const w = I(
|
|
130
|
+
{
|
|
131
|
+
blockProps: {},
|
|
132
|
+
inBuilder: !1,
|
|
133
|
+
...m,
|
|
134
|
+
index: $,
|
|
135
|
+
...rt(it(o, i === d ? "" : i, u), e),
|
|
136
|
+
...B(m),
|
|
137
|
+
...C,
|
|
138
|
+
metadata: c,
|
|
139
|
+
lang: i || d
|
|
140
|
+
},
|
|
141
|
+
["_parent"]
|
|
136
142
|
);
|
|
143
|
+
if (J(u, "dataProvider")) {
|
|
144
|
+
const O = p(
|
|
145
|
+
u,
|
|
146
|
+
"suspenseFallback",
|
|
147
|
+
ot
|
|
148
|
+
);
|
|
149
|
+
return /* @__PURE__ */ a.jsx(y, { fallback: q(O), children: /* @__PURE__ */ a.jsx(
|
|
150
|
+
tt,
|
|
151
|
+
{
|
|
152
|
+
lang: i || d,
|
|
153
|
+
metadata: c,
|
|
154
|
+
dataProvider: u.dataProvider,
|
|
155
|
+
block: o,
|
|
156
|
+
component: x,
|
|
157
|
+
props: w
|
|
158
|
+
}
|
|
159
|
+
) });
|
|
160
|
+
}
|
|
161
|
+
return /* @__PURE__ */ a.jsx(y, { children: S.createElement(x, w) });
|
|
137
162
|
}
|
|
138
|
-
return /* @__PURE__ */
|
|
139
|
-
|
|
163
|
+
return /* @__PURE__ */ a.jsxs("noscript", { children: [
|
|
164
|
+
o._type,
|
|
140
165
|
" not found"
|
|
141
166
|
] });
|
|
142
167
|
})
|
|
143
168
|
) });
|
|
144
169
|
}
|
|
145
|
-
async function k(t, r, e = [], s = "", n = !1) {
|
|
146
|
-
return await v({
|
|
147
|
-
tailwindConfig: {
|
|
148
|
-
darkMode: "class",
|
|
149
|
-
safelist: e,
|
|
150
|
-
theme: { extend: M(t) },
|
|
151
|
-
plugins: [F, U, z, q],
|
|
152
|
-
corePlugins: { preflight: n },
|
|
153
|
-
...s ? { prefix: `${s}` } : {}
|
|
154
|
-
}
|
|
155
|
-
}).generateStylesFromContent(
|
|
156
|
-
` ${n ? "@tailwind base;" : ""}
|
|
157
|
-
@tailwind components;
|
|
158
|
-
@tailwind utilities;`,
|
|
159
|
-
r
|
|
160
|
-
);
|
|
161
|
-
}
|
|
162
|
-
const tt = (t, r, e = !1) => k(r, [L(JSON.stringify(t), /#styles:,?/g, "")], [], "", e), mt = async (t, r = {}, e = !0) => await tt(t, r, e);
|
|
163
170
|
export {
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
171
|
+
at as RenderChaiBlocks,
|
|
172
|
+
_t as convertToBlocks,
|
|
173
|
+
Bt as getChaiThemeCssVariables,
|
|
174
|
+
jt as getStylesForBlocks,
|
|
175
|
+
Et as getThemeFontsCSSImport,
|
|
176
|
+
$t as getThemeFontsLinkMarkup
|
|
167
177
|
};
|
package/dist/runtime.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("@chaibuilder/runtime");Object.keys(t).forEach(e=>{e!=="default"&&!Object.prototype.hasOwnProperty.call(exports,e)&&Object.defineProperty(exports,e,{enumerable:!0,get:()=>t[e]})});
|