@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.js CHANGED
@@ -676,7 +676,7 @@ function SlideElementHost({
676
676
  touchAction: canMove ? "none" : void 0,
677
677
  ...buildAnimation ? buildEnterStyle(buildAnimation, buildDelay) : null
678
678
  };
679
- const inner = renderInner({ element, theme, slideWidthPx, editing, selected, onContentChange, paraReveal }) ?? renderElement?.(element, slideWidthPx);
679
+ const inner = renderInner({ element, theme, slideWidthPx, editing, selected, onContentChange, paraReveal }) ?? renderElement?.(element, slideWidthPx) ?? elementPlaceholder(element);
680
680
  return /* @__PURE__ */ jsxs(
681
681
  "div",
682
682
  {
@@ -771,6 +771,37 @@ function renderInner({ element, theme, slideWidthPx, editing, selected, onConten
771
771
  return null;
772
772
  }
773
773
  }
774
+ function elementPlaceholder(element) {
775
+ if (element.type !== "chart" && element.type !== "code" && element.type !== "table" && element.type !== "embed") {
776
+ return null;
777
+ }
778
+ const label = element.type.charAt(0).toUpperCase() + element.type.slice(1);
779
+ return /* @__PURE__ */ jsxs(
780
+ "div",
781
+ {
782
+ style: {
783
+ width: "100%",
784
+ height: "100%",
785
+ display: "flex",
786
+ flexDirection: "column",
787
+ alignItems: "center",
788
+ justifyContent: "center",
789
+ gap: "0.35em",
790
+ textAlign: "center",
791
+ padding: "0.5em",
792
+ boxSizing: "border-box",
793
+ border: "1px dashed currentColor",
794
+ borderRadius: 8,
795
+ opacity: 0.55,
796
+ overflow: "hidden"
797
+ },
798
+ children: [
799
+ /* @__PURE__ */ jsx("span", { style: { fontWeight: 600 }, children: label }),
800
+ /* @__PURE__ */ jsx("span", { style: { fontSize: "0.7em", opacity: 0.8 }, children: "Pass renderElement to render" })
801
+ ]
802
+ }
803
+ );
804
+ }
774
805
  function orderedElements(elements) {
775
806
  return [...elements].sort((a, b) => {
776
807
  const az = a.z ?? -1;