@particle-academy/fancy-slides 0.5.0 → 0.5.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.cjs CHANGED
@@ -718,7 +718,7 @@ function SlideElementHost({
718
718
  touchAction: canMove ? "none" : void 0,
719
719
  ...buildAnimation ? buildEnterStyle(buildAnimation, buildDelay) : null
720
720
  };
721
- const inner = renderInner({ element, theme, slideWidthPx, editing, selected, onContentChange, paraReveal }) ?? renderElement?.(element, slideWidthPx);
721
+ const inner = renderInner({ element, theme, slideWidthPx, editing, selected, onContentChange, paraReveal }) ?? renderElement?.(element, slideWidthPx) ?? elementPlaceholder(element);
722
722
  return /* @__PURE__ */ jsxRuntime.jsxs(
723
723
  "div",
724
724
  {
@@ -813,6 +813,37 @@ function renderInner({ element, theme, slideWidthPx, editing, selected, onConten
813
813
  return null;
814
814
  }
815
815
  }
816
+ function elementPlaceholder(element) {
817
+ if (element.type !== "chart" && element.type !== "code" && element.type !== "table" && element.type !== "embed") {
818
+ return null;
819
+ }
820
+ const label = element.type.charAt(0).toUpperCase() + element.type.slice(1);
821
+ return /* @__PURE__ */ jsxRuntime.jsxs(
822
+ "div",
823
+ {
824
+ style: {
825
+ width: "100%",
826
+ height: "100%",
827
+ display: "flex",
828
+ flexDirection: "column",
829
+ alignItems: "center",
830
+ justifyContent: "center",
831
+ gap: "0.35em",
832
+ textAlign: "center",
833
+ padding: "0.5em",
834
+ boxSizing: "border-box",
835
+ border: "1px dashed currentColor",
836
+ borderRadius: 8,
837
+ opacity: 0.55,
838
+ overflow: "hidden"
839
+ },
840
+ children: [
841
+ /* @__PURE__ */ jsxRuntime.jsx("span", { style: { fontWeight: 600 }, children: label }),
842
+ /* @__PURE__ */ jsxRuntime.jsx("span", { style: { fontSize: "0.7em", opacity: 0.8 }, children: "Pass renderElement to render" })
843
+ ]
844
+ }
845
+ );
846
+ }
816
847
  function orderedElements(elements) {
817
848
  return [...elements].sort((a, b) => {
818
849
  const az = a.z ?? -1;