@rainbow-robotics/preview-host 0.1.2-dev.6 → 0.1.2-dev.8

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.
Files changed (29) hide show
  1. package/dist/assets/{__federation_expose_App.B-7yegU_.js → __federation_expose_App.DTILpvFM.js} +154 -154
  2. package/dist/assets/{cssMode.BVhnq_6y.js → cssMode.CxPsxiNP.js} +1 -1
  3. package/dist/assets/{freemarker2.DtoqwD_L.js → freemarker2.e18W-vVC.js} +1 -1
  4. package/dist/assets/{handlebars.UmYoTOId.js → handlebars.DpGUQTlC.js} +1 -1
  5. package/dist/assets/{html.DC0Vlx9N.js → html.qS8AwR-R.js} +1 -1
  6. package/dist/assets/{htmlMode.cZn_7xZQ.js → htmlMode.D4pEgAMn.js} +1 -1
  7. package/dist/assets/{index.C3X9hmTL.js → index.Dxudgz78.js} +1 -1
  8. package/dist/assets/{javascript.CxVqa5p8.js → javascript.CIRAbwTJ.js} +1 -1
  9. package/dist/assets/{jsonMode.BQsXaCAy.js → jsonMode.CJcA6JGm.js} +1 -1
  10. package/dist/assets/{liquid.ctNTffmu.js → liquid.Cd_ynsyQ.js} +1 -1
  11. package/dist/assets/{lspLanguageFeatures.CIBenPTg.js → lspLanguageFeatures.ZrhgItxw.js} +1 -1
  12. package/dist/assets/{mdx.CEwN4-mU.js → mdx.E9Mhxtu7.js} +1 -1
  13. package/dist/assets/{python.DFiX7UCg.js → python.BUTzvd2f.js} +1 -1
  14. package/dist/assets/{razor.6V_1uJ45.js → razor.CI_gj0Fd.js} +1 -1
  15. package/dist/assets/remoteEntry.js +1 -1
  16. package/dist/assets/{tsMode.CtIlnNw7.js → tsMode.DBpdjX7n.js} +1 -1
  17. package/dist/assets/{typescript.D1htxZ_X.js → typescript.WM3o_g0z.js} +1 -1
  18. package/dist/assets/{xml.D6hYgOkJ.js → xml.D7f39jWM.js} +1 -1
  19. package/dist/assets/{yaml.BPMLV51E.js → yaml.BLLpRCf_.js} +1 -1
  20. package/dist/index.html +2 -2
  21. package/dist/plugin-runtime/@rainbow-robotics/plugin-ui/chunks/chunk-37HVFFJB.js +1 -0
  22. package/dist/plugin-runtime/@rainbow-robotics/plugin-ui/chunks/{chunk-3DOWEHFU.js → chunk-4MGSRUAS.js} +1 -1
  23. package/dist/plugin-runtime/@rainbow-robotics/plugin-ui/connect.js +1 -1
  24. package/dist/plugin-runtime/@rainbow-robotics/plugin-ui/elements.js +1 -1
  25. package/dist/plugin-runtime/@rainbow-robotics/plugin-ui/react.js +1 -1
  26. package/dist/plugin-runtime/@rainbow-robotics/plugin-ui/sdk.js +1 -1
  27. package/package.json +2 -2
  28. package/serve.mjs +12 -8
  29. package/dist/plugin-runtime/@rainbow-robotics/plugin-ui/chunks/chunk-HJVATDC6.js +0 -1
@@ -1 +1 @@
1
- import{b as a,c as b,d as c,e as d,f as e,g as f,h as g,i as h,j as i}from"./chunks/chunk-3DOWEHFU.js";import"./chunks/chunk-HJVATDC6.js";export{h as RB_ELEMENT_NAMES,b as RbButtonElement,c as RbIconButtonElement,g as RbSelectElement,a as RbSliderElement,f as RbSwitchElement,d as RbTextElement,e as RbTextInputElement,i as defineElements};
1
+ import{b as a,c as b,d as c,e as d,f as e,g as f,h as g,i as h,j as i}from"./chunks/chunk-4MGSRUAS.js";import"./chunks/chunk-37HVFFJB.js";export{h as RB_ELEMENT_NAMES,b as RbButtonElement,c as RbIconButtonElement,g as RbSelectElement,a as RbSliderElement,f as RbSwitchElement,d as RbTextElement,e as RbTextInputElement,i as defineElements};
@@ -1 +1 @@
1
- import{b as A}from"./chunks/chunk-Q6XGCIPE.js";import{b as d,c as x,d as h,e as S,f as C,g as y,h as g}from"./chunks/chunk-3DOWEHFU.js";import"./chunks/chunk-HJVATDC6.js";import{forwardRef as L,useRef as T,isValidElement as k,cloneElement as M,createElement as I,useLayoutEffect as O}from"react";function o(n,w=customElements.get(n),{slotProps:m=!0,eventProps:B={}}={}){let N=!!m,c=(typeof m=="object"?m.wrapper:void 0)??!0,E=typeof c=="string"?c:c?"remote-fragment":!1,u=L(function(l,i){let a=T(),v=T(),r={},R=V(l.children);for(let e in l){let t=l[e];if(e==="slot"){r.slot=t;continue}if(N&&w.remoteSlotDefinitions.has(e)&&k(t)){E?R.push(I(E,{slot:e},t)):R.push(M(t,{slot:e}));continue}r[e]=t}return O(()=>{let e=a.current;if(e!=null){for(let t in r){if(t==="children")continue;let b=v.current?.[t],s=r[t];if(b===s)continue;let P=B[t];if(P){let f=P.event;b&&e.removeEventListener(f,b),s&&e.addEventListener(f,s);continue}if(t in e){e[t]=r[t];continue}s==null?e.removeAttribute(t):e.setAttribute(t,String(s))}v.current=r}}),I(n,{ref:e=>{a.current=e,typeof i=="function"?i(e):i!=null&&(i.current=e)}},...R)});return u.displayName=`RemoteComponent(${n})`,u}function V(n){return n==null?[]:Array.isArray(n)?[...n]:[n]}var p=n=>({eventProps:n}),G=o("rb-slider",d,p({onChange:{event:"change"}})),H=o("rb-button",x,p({onPress:{event:"press"}})),J=o("rb-icon-button",h,p({onPress:{event:"press"}})),K=o("rb-text",S),Q=o("rb-text-input",C,p({onInput:{event:"input"}})),U=o("rb-switch",y,p({onChange:{event:"change"}})),X=o("rb-select",g,p({onChange:{event:"change"}}));export{H as Button,J as IconButton,X as Select,G as Slider,U as Switch,K as Text,Q as TextInput,A as useRb};
1
+ import{b as A}from"./chunks/chunk-Q6XGCIPE.js";import{b as d,c as x,d as h,e as S,f as C,g as y,h as g}from"./chunks/chunk-4MGSRUAS.js";import"./chunks/chunk-37HVFFJB.js";import{forwardRef as L,useRef as T,isValidElement as k,cloneElement as M,createElement as I,useLayoutEffect as O}from"react";function o(n,w=customElements.get(n),{slotProps:m=!0,eventProps:B={}}={}){let N=!!m,c=(typeof m=="object"?m.wrapper:void 0)??!0,E=typeof c=="string"?c:c?"remote-fragment":!1,u=L(function(l,i){let a=T(),v=T(),r={},R=V(l.children);for(let e in l){let t=l[e];if(e==="slot"){r.slot=t;continue}if(N&&w.remoteSlotDefinitions.has(e)&&k(t)){E?R.push(I(E,{slot:e},t)):R.push(M(t,{slot:e}));continue}r[e]=t}return O(()=>{let e=a.current;if(e!=null){for(let t in r){if(t==="children")continue;let b=v.current?.[t],s=r[t];if(b===s)continue;let P=B[t];if(P){let f=P.event;b&&e.removeEventListener(f,b),s&&e.addEventListener(f,s);continue}if(t in e){e[t]=r[t];continue}s==null?e.removeAttribute(t):e.setAttribute(t,String(s))}v.current=r}}),I(n,{ref:e=>{a.current=e,typeof i=="function"?i(e):i!=null&&(i.current=e)}},...R)});return u.displayName=`RemoteComponent(${n})`,u}function V(n){return n==null?[]:Array.isArray(n)?[...n]:[n]}var p=n=>({eventProps:n}),G=o("rb-slider",d,p({onChange:{event:"change"}})),H=o("rb-button",x,p({onPress:{event:"press"}})),J=o("rb-icon-button",h,p({onPress:{event:"press"}})),K=o("rb-text",S),Q=o("rb-text-input",C,p({onInput:{event:"input"}})),U=o("rb-switch",y,p({onChange:{event:"change"}})),X=o("rb-select",g,p({onChange:{event:"change"}}));export{H as Button,J as IconButton,X as Select,G as Slider,U as Switch,K as Text,Q as TextInput,A as useRb};
@@ -1 +1 @@
1
- import{a,b}from"./chunks/chunk-Q6XGCIPE.js";import"./chunks/chunk-HJVATDC6.js";export{a as RbContext,b as useRb};
1
+ import{a,b}from"./chunks/chunk-Q6XGCIPE.js";import"./chunks/chunk-37HVFFJB.js";export{a as RbContext,b as useRb};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rainbow-robotics/preview-host",
3
- "version": "0.1.2-dev.6",
3
+ "version": "0.1.2-dev.8",
4
4
  "type": "module",
5
5
  "engines": {
6
6
  "node": ">=20"
@@ -27,6 +27,6 @@
27
27
  "prepack": "node build.mjs"
28
28
  },
29
29
  "dependencies": {
30
- "@rainbow-robotics/plugin-ui": "*"
30
+ "@rainbow-robotics/plugin-ui": "0.1.2-dev.8"
31
31
  }
32
32
  }
package/serve.mjs CHANGED
@@ -37,6 +37,7 @@ const runtimeDir = resolve(arg("runtime", resolvePluginUiDistBrowser()));
37
37
  const pluginDir = arg("plugin", "")
38
38
  ? resolve(arg("plugin", ""))
39
39
  : "";
40
+ const socketUrl = arg("socket-url", "");
40
41
  const PLUGIN_BASE = "/plugin-dev";
41
42
  const RUNTIME_BASE = "/plugin-runtime";
42
43
 
@@ -67,16 +68,19 @@ if (!existsSync(distDir)) {
67
68
  }
68
69
 
69
70
  // index.html with the preview-host globals injected (host flag + plugin base).
71
+ const injectedLines = [
72
+ " <script>",
73
+ " window.__RB_PLUGIN_PREVIEW_HOST__ = true;",
74
+ " window.__RB_ASSETS_BASE_URL__ = window.location.origin;",
75
+ ` window.__RB_PLUGIN_PREVIEW_BASE__ = ${JSON.stringify(PLUGIN_BASE)};`,
76
+ ];
77
+ if (socketUrl) {
78
+ injectedLines.push(` window.__RB_PLUGIN_PREVIEW_SOCKET_URL__ = ${JSON.stringify(socketUrl)};`);
79
+ }
80
+ injectedLines.push(" </script>", " </head>");
70
81
  const indexHtml = readFileSync(join(distDir, "index.html"), "utf8").replace(
71
82
  "</head>",
72
- [
73
- " <script>",
74
- " window.__RB_PLUGIN_PREVIEW_HOST__ = true;",
75
- " window.__RB_ASSETS_BASE_URL__ = window.location.origin;",
76
- ` window.__RB_PLUGIN_PREVIEW_BASE__ = ${JSON.stringify(PLUGIN_BASE)};`,
77
- " </script>",
78
- " </head>",
79
- ].join("\n"),
83
+ injectedLines.join("\n"),
80
84
  );
81
85
 
82
86
  function sendFile(res, filePath) {
@@ -1 +0,0 @@
1
- var i=Object.create;var f=Object.defineProperty;var j=Object.getOwnPropertyDescriptor;var k=Object.getOwnPropertyNames;var l=Object.getPrototypeOf,m=Object.prototype.hasOwnProperty;var h=b=>{throw TypeError(b)};var n=(b,a,c)=>a in b?f(b,a,{enumerable:!0,configurable:!0,writable:!0,value:c}):b[a]=c;var p=(b,a)=>()=>(a||b((a={exports:{}}).exports,a),a.exports),q=(b,a)=>{for(var c in a)f(b,c,{get:a[c],enumerable:!0})},o=(b,a,c,d)=>{if(a&&typeof a=="object"||typeof a=="function")for(let e of k(a))!m.call(b,e)&&e!==c&&f(b,e,{get:()=>a[e],enumerable:!(d=j(a,e))||d.enumerable});return b};var r=(b,a,c)=>(c=b!=null?i(l(b)):{},o(a||!b||!b.__esModule?f(c,"default",{value:b,enumerable:!0}):c,b));var s=(b,a,c)=>n(b,typeof a!="symbol"?a+"":a,c),g=(b,a,c)=>a.has(b)||h("Cannot "+c);var t=(b,a,c)=>(g(b,a,"read from private field"),c?c.call(b):a.get(b)),u=(b,a,c)=>a.has(b)?h("Cannot add the same private member more than once"):a instanceof WeakSet?a.add(b):a.set(b,c),v=(b,a,c,d)=>(g(b,a,"write to private field"),d?d.call(b,c):a.set(b,c),c),w=(b,a,c)=>(g(b,a,"access private method"),c);export{p as a,q as b,r as c,s as d,t as e,u as f,v as g,w as h};