@plasmicapp/loader-react 2.0.0-alpha.0 → 2.0.0-alpha.1
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/index.d.ts +34 -3
- package/dist/index.esm.js +13 -11
- package/dist/index.esm.js.map +3 -3
- package/dist/index.js +13 -11
- package/dist/index.js.map +3 -3
- package/dist/react-server.d.ts +0 -2
- package/dist/react-server.esm.js +1 -2
- package/dist/react-server.esm.js.map +2 -2
- package/dist/react-server.js +1 -2
- package/dist/react-server.js.map +2 -2
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -99,6 +99,7 @@ __export(src_exports, {
|
|
|
99
99
|
initPlasmicLoader: () => initPlasmicLoader,
|
|
100
100
|
matchesPagePath: () => matchesPagePath,
|
|
101
101
|
plasmicPrepass: () => plasmicPrepass,
|
|
102
|
+
renderToElement: () => renderToElement,
|
|
102
103
|
renderToString: () => renderToString,
|
|
103
104
|
repeatedElement: () => import_host3.repeatedElement,
|
|
104
105
|
useDataEnv: () => import_host3.useDataEnv,
|
|
@@ -1223,7 +1224,6 @@ var InternalPlasmicComponentLoader = class extends BaseInternalPlasmicComponentL
|
|
|
1223
1224
|
"@plasmicapp/query": PlasmicQuery,
|
|
1224
1225
|
"@plasmicapp/data-sources-context": PlasmicDataSourcesContext,
|
|
1225
1226
|
"@plasmicapp/host": PlasmicHost,
|
|
1226
|
-
"@plasmicapp/host/registerFunction": internalSetRegisteredFunction,
|
|
1227
1227
|
"@plasmicapp/loader-runtime-registry": {
|
|
1228
1228
|
components: SUBSTITUTED_COMPONENTS,
|
|
1229
1229
|
globalVariantHooks: SUBSTITUTED_GLOBAL_VARIANT_HOOKS,
|
|
@@ -1449,11 +1449,11 @@ function plasmicPrepass(element) {
|
|
|
1449
1449
|
// src/render.tsx
|
|
1450
1450
|
var import_prepass2 = require("@plasmicapp/prepass");
|
|
1451
1451
|
var import_react2 = __toESM(require("react"));
|
|
1452
|
-
var
|
|
1453
|
-
var import_server = require("react-dom/server");
|
|
1452
|
+
var import_client = __toESM(require("react-dom/client"));
|
|
1453
|
+
var import_server = __toESM(require("react-dom/server"));
|
|
1454
1454
|
function renderToString(loader, lookup, opts = {}) {
|
|
1455
1455
|
const element = makeElement(loader, lookup, opts);
|
|
1456
|
-
return
|
|
1456
|
+
return import_server.default.renderToString(element);
|
|
1457
1457
|
}
|
|
1458
1458
|
function extractPlasmicQueryDataFromElement(_0, _1) {
|
|
1459
1459
|
return __async(this, arguments, function* (loader, lookup, opts = {}) {
|
|
@@ -1461,13 +1461,15 @@ function extractPlasmicQueryDataFromElement(_0, _1) {
|
|
|
1461
1461
|
return (0, import_prepass2.extractPlasmicQueryData)(element);
|
|
1462
1462
|
});
|
|
1463
1463
|
}
|
|
1464
|
-
function
|
|
1465
|
-
|
|
1466
|
-
|
|
1467
|
-
|
|
1468
|
-
|
|
1469
|
-
|
|
1470
|
-
|
|
1464
|
+
function renderToElement(loader, target, lookup, opts = {}) {
|
|
1465
|
+
const element = makeElement(loader, lookup, opts);
|
|
1466
|
+
const root = import_client.default.createRoot(target);
|
|
1467
|
+
root.render(element);
|
|
1468
|
+
return root;
|
|
1469
|
+
}
|
|
1470
|
+
function hydrateFromElement(loader, target, lookup, opts = {}) {
|
|
1471
|
+
const element = makeElement(loader, lookup, opts);
|
|
1472
|
+
return import_client.default.hydrateRoot(target, element);
|
|
1471
1473
|
}
|
|
1472
1474
|
function makeElement(loader, lookup, opts = {}) {
|
|
1473
1475
|
return /* @__PURE__ */ import_react2.default.createElement(
|