@1urso/generic-editor 0.1.72 → 0.1.73

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.
@@ -8853,7 +8853,7 @@ function Ot({ children: n, className: _, elementRef: E, id: O, style: A, ...j })
8853
8853
  Ot.displayName = "Separator";
8854
8854
  var package_default = {
8855
8855
  name: "@1urso/generic-editor",
8856
- version: "0.1.72",
8856
+ version: "0.1.73",
8857
8857
  publishConfig: { access: "public" },
8858
8858
  type: "module",
8859
8859
  main: "./dist/generic-editor.umd.cjs",
@@ -9513,12 +9513,15 @@ const EditorProvider = ({ children: n, isList: E = !1, availableProps: O = [], t
9513
9513
  return /* @__PURE__ */ jsxs(p$1, {
9514
9514
  gap: "2",
9515
9515
  align: "center",
9516
+ wrap: "wrap",
9516
9517
  style: {
9517
9518
  backgroundColor: "var(--color-panel-solid)",
9518
9519
  padding: "8px",
9519
9520
  borderRadius: "8px",
9520
9521
  boxShadow: "0 2px 10px rgba(0,0,0,0.1)",
9521
- border: "1px solid var(--gray-5)"
9522
+ border: "1px solid var(--gray-5)",
9523
+ maxWidth: "90vw",
9524
+ justifyContent: "center"
9522
9525
  },
9523
9526
  children: [
9524
9527
  /* @__PURE__ */ jsx(o$2, {
@@ -13145,7 +13148,7 @@ const ElementContextMenu = ({ children: n, element: _ }) => {
13145
13148
  if (E.button === 2) return;
13146
13149
  let O = E.target;
13147
13150
  if (O.closest(".resize-handle") || O.closest(".rotate-handle")) return;
13148
- if (E.currentTarget.setPointerCapture(E.pointerId), E.button === 1 || E.button === 0 && QF.current) {
13151
+ if (E.currentTarget.setPointerCapture(E.pointerId), E.button === 1 || E.button === 0 && QF.current || E.pointerType === "touch") {
13149
13152
  E.preventDefault(), ZF.current = !0, nI.current = {
13150
13153
  x: E.clientX,
13151
13154
  y: E.clientY
@@ -21519,7 +21522,10 @@ const ShortcutsDialog = () => /* @__PURE__ */ jsxs(s$4, { children: [/* @__PURE_
21519
21522
  children: "Agilize seu fluxo de trabalho com estes atalhos."
21520
21523
  }),
21521
21524
  /* @__PURE__ */ jsxs(o$1, {
21522
- columns: "2",
21525
+ columns: {
21526
+ initial: "1",
21527
+ sm: "2"
21528
+ },
21523
21529
  gap: "6",
21524
21530
  children: [/* @__PURE__ */ jsxs(p, { children: [
21525
21531
  /* @__PURE__ */ jsx(p$2, {
@@ -21675,12 +21681,12 @@ const ShortcutsDialog = () => /* @__PURE__ */ jsxs(s$4, { children: [/* @__PURE_
21675
21681
  A.forEach((_) => {
21676
21682
  n = Math.min(n, _.x), O = Math.min(O, _.y), j = Math.max(j, _.x + _.width), M = Math.max(M, _.y + _.height);
21677
21683
  });
21678
- let N = j - n + 100, P = M - O + 100, z = window.innerWidth - 300, B = window.innerHeight - 100, H = z / N, U = B / P, W = Math.min(H, U);
21679
- W = Math.min(Math.max(W, .1), 5), _(W);
21680
- let G = (n + j) / 2, Z = (O + M) / 2, YF = z / 2, XF = B / 2;
21684
+ let N = j - n + 100, P = M - O + 100, z = window.innerWidth < 768 ? 0 : 300, B = window.innerWidth - z, H = window.innerHeight - 100, U = B / N, W = H / P, G = Math.min(U, W);
21685
+ G = Math.min(Math.max(G, .1), 5), _(G);
21686
+ let Z = (n + j) / 2, YF = (O + M) / 2, XF = B / 2, ZF = H / 2;
21681
21687
  E({
21682
- x: YF - G * W,
21683
- y: XF - Z * W
21688
+ x: XF - Z * G,
21689
+ y: ZF - YF * G
21684
21690
  });
21685
21691
  },
21686
21692
  children: /* @__PURE__ */ jsx(AspectRatioIcon, {})
@@ -21693,7 +21699,8 @@ var EditorContent = ({ layout: n, initialState: E, onSave: O, theme: A = "light"
21693
21699
  let [P, z] = useState(!0), [B, H] = useState(!0), [U, W] = useState(null), [G, Z] = useState(!1), [YF, XF] = useState(!1), [ZF, QF] = useState(j && j.length > 0 ? j[0].id : null), $F = React.useRef(null), { addElement: eI, loadState: nI, state: rI, undo: iI, redo: aI, copy: oI, paste: sI, removeSelected: uI, updateElements: dI } = useEditor(), fI = React.useRef(null);
21694
21700
  React.useEffect(() => {
21695
21701
  let n = () => {
21696
- XF(window.innerWidth < 768);
21702
+ let n = window.innerWidth < 768;
21703
+ XF(n), n && (H(!1), z(!1));
21697
21704
  };
21698
21705
  return n(), window.addEventListener("resize", n), () => window.removeEventListener("resize", n);
21699
21706
  }, []);
@@ -21842,513 +21849,513 @@ var EditorContent = ({ layout: n, initialState: E, onSave: O, theme: A = "light"
21842
21849
  grayColor: "slate",
21843
21850
  radius: "large",
21844
21851
  scaling: "105%",
21845
- children: [
21846
- /* @__PURE__ */ jsxs(p$1, {
21847
- direction: "row",
21852
+ children: [/* @__PURE__ */ jsxs(p$1, {
21853
+ direction: "row",
21854
+ style: {
21855
+ height: "100vh",
21856
+ width: "100%",
21857
+ overflow: "hidden",
21858
+ backgroundColor: "var(--gray-1)"
21859
+ },
21860
+ children: [B && /* @__PURE__ */ jsxs(p$1, {
21861
+ direction: "column",
21862
+ width: YF ? "100%" : "300px",
21848
21863
  style: {
21849
- height: "100vh",
21850
- width: "100%",
21864
+ borderRight: "1px solid var(--gray-5)",
21865
+ backgroundColor: "var(--gray-1)",
21866
+ flexShrink: 0,
21867
+ height: "100%",
21868
+ boxShadow: "1px 0 0 var(--gray-4)",
21851
21869
  overflow: "hidden",
21852
- backgroundColor: "var(--gray-1)"
21870
+ position: YF ? "absolute" : "relative",
21871
+ zIndex: YF ? 100 : "auto",
21872
+ top: 0,
21873
+ left: 0
21853
21874
  },
21854
- children: [B && /* @__PURE__ */ jsx(p$1, {
21855
- direction: "column",
21856
- width: "300px",
21857
- style: {
21858
- borderRight: "1px solid var(--gray-5)",
21859
- backgroundColor: "var(--gray-1)",
21860
- flexShrink: 0,
21861
- height: "100%",
21862
- boxShadow: "1px 0 0 var(--gray-4)",
21863
- overflow: "hidden"
21864
- },
21865
- children: /* @__PURE__ */ jsx(c, {
21866
- type: "auto",
21867
- scrollbars: "vertical",
21868
- style: { height: "100%" },
21869
- children: /* @__PURE__ */ jsxs(p$1, {
21870
- direction: "column",
21871
- children: [/* @__PURE__ */ jsx(p, {
21872
- p: "4",
21873
- style: {
21874
- borderBottom: "1px solid var(--gray-5)",
21875
- backgroundColor: "var(--gray-1)"
21876
- },
21877
- children: /* @__PURE__ */ jsx(p$1, {
21878
- direction: "column",
21879
- gap: "3",
21880
- children: /* @__PURE__ */ jsxs(p, { children: [
21881
- /* @__PURE__ */ jsxs(p$1, {
21882
- justify: "between",
21883
- align: "center",
21884
- mb: "2",
21885
- children: [/* @__PURE__ */ jsx(p$2, {
21886
- size: "2",
21887
- weight: "bold",
21888
- children: "Editor"
21889
- }), /* @__PURE__ */ jsxs(e, {
21890
- color: "gray",
21891
- variant: "soft",
21892
- radius: "full",
21893
- children: ["v", package_default.version]
21894
- })]
21895
- }),
21896
- /* @__PURE__ */ jsxs(I$2, { children: [/* @__PURE__ */ jsx(h$1, { children: /* @__PURE__ */ jsx(o, {
21897
- variant: "solid",
21898
- color: "green",
21899
- size: "3",
21875
+ children: [YF && /* @__PURE__ */ jsx(p$1, {
21876
+ justify: "end",
21877
+ p: "2",
21878
+ children: /* @__PURE__ */ jsx(o$2, {
21879
+ variant: "ghost",
21880
+ color: "gray",
21881
+ onClick: () => H(!1),
21882
+ children: /* @__PURE__ */ jsx(DoubleArrowLeftIcon, {})
21883
+ })
21884
+ }), /* @__PURE__ */ jsx(c, {
21885
+ type: "auto",
21886
+ scrollbars: "vertical",
21887
+ style: { height: "100%" },
21888
+ children: /* @__PURE__ */ jsxs(p$1, {
21889
+ direction: "column",
21890
+ children: [/* @__PURE__ */ jsx(p, {
21891
+ p: "4",
21892
+ style: {
21893
+ borderBottom: "1px solid var(--gray-5)",
21894
+ backgroundColor: "var(--gray-1)"
21895
+ },
21896
+ children: /* @__PURE__ */ jsx(p$1, {
21897
+ direction: "column",
21898
+ gap: "3",
21899
+ children: /* @__PURE__ */ jsxs(p, { children: [
21900
+ /* @__PURE__ */ jsxs(p$1, {
21901
+ justify: "between",
21902
+ align: "center",
21903
+ mb: "2",
21904
+ children: [/* @__PURE__ */ jsx(p$2, {
21905
+ size: "2",
21906
+ weight: "bold",
21907
+ children: "Editor"
21908
+ }), /* @__PURE__ */ jsxs(e, {
21909
+ color: "gray",
21910
+ variant: "soft",
21911
+ radius: "full",
21912
+ children: ["v", package_default.version]
21913
+ })]
21914
+ }),
21915
+ /* @__PURE__ */ jsxs(I$2, { children: [/* @__PURE__ */ jsx(h$1, { children: /* @__PURE__ */ jsx(o, {
21916
+ variant: "solid",
21917
+ color: "green",
21918
+ size: "3",
21919
+ style: {
21920
+ width: "100%",
21921
+ cursor: "pointer",
21922
+ justifyContent: "center",
21923
+ marginBottom: "8px"
21924
+ },
21925
+ children: "Adicionar elemento"
21926
+ }) }), /* @__PURE__ */ jsxs(g$1, {
21927
+ style: { width: "240px" },
21928
+ children: [
21929
+ /* @__PURE__ */ jsx(v$3, {
21930
+ onSelect: () => _I("text"),
21931
+ children: "Texto"
21932
+ }),
21933
+ /* @__PURE__ */ jsx(v$3, {
21934
+ onSelect: () => _I("image"),
21935
+ children: "Imagem"
21936
+ }),
21937
+ /* @__PURE__ */ jsx(v$3, {
21938
+ onSelect: () => _I("box"),
21939
+ children: "Caixa (Container)"
21940
+ }),
21941
+ /* @__PURE__ */ jsx(v$3, {
21942
+ onSelect: () => _I("text-container"),
21943
+ children: "Container com Texto"
21944
+ })
21945
+ ]
21946
+ })] }),
21947
+ /* @__PURE__ */ jsxs(o, {
21948
+ variant: "soft",
21949
+ color: "blue",
21950
+ style: {
21951
+ width: "100%",
21952
+ justifyContent: "center",
21953
+ cursor: "pointer"
21954
+ },
21955
+ onClick: () => {
21956
+ if (O) {
21957
+ let n = {
21958
+ elements: rI.elements,
21959
+ isList: rI.isList,
21960
+ mockData: rI.mockData,
21961
+ singleMockData: rI.singleMockData,
21962
+ listSettings: rI.listSettings,
21963
+ canvasHeight: rI.canvasHeight
21964
+ };
21965
+ O(JSON.stringify(n, null, 2));
21966
+ }
21967
+ },
21968
+ children: [/* @__PURE__ */ jsx(Share1Icon, {}), " Salvar Alterações"]
21969
+ }),
21970
+ /* @__PURE__ */ jsxs(p$1, {
21971
+ gap: "2",
21972
+ mt: "2",
21973
+ children: [/* @__PURE__ */ jsxs(o, {
21974
+ variant: "soft",
21975
+ color: "gray",
21900
21976
  style: {
21901
- width: "100%",
21977
+ flex: 1,
21902
21978
  cursor: "pointer",
21903
- justifyContent: "center",
21904
- marginBottom: "8px"
21979
+ justifyContent: "center"
21905
21980
  },
21906
- children: "Adicionar elemento"
21907
- }) }), /* @__PURE__ */ jsxs(g$1, {
21908
- style: { width: "240px" },
21981
+ onClick: pI,
21982
+ children: [/* @__PURE__ */ jsx(DownloadIcon, {}), " Exportar"]
21983
+ }), /* @__PURE__ */ jsxs(o, {
21984
+ variant: "soft",
21985
+ color: "gray",
21986
+ style: {
21987
+ flex: 1,
21988
+ cursor: "pointer",
21989
+ justifyContent: "center"
21990
+ },
21991
+ onClick: mI,
21992
+ children: [/* @__PURE__ */ jsx(UploadIcon, {}), " Importar"]
21993
+ })]
21994
+ }),
21995
+ /* @__PURE__ */ jsx("input", {
21996
+ type: "file",
21997
+ ref: fI,
21998
+ style: { display: "none" },
21999
+ accept: ".json",
22000
+ onChange: hI
22001
+ }),
22002
+ /* @__PURE__ */ jsxs(p, {
22003
+ mt: "3",
22004
+ style: {
22005
+ backgroundColor: "var(--gray-2)",
22006
+ border: "1px solid var(--gray-4)",
22007
+ borderRadius: 12,
22008
+ padding: 12
22009
+ },
22010
+ children: [/* @__PURE__ */ jsx(p$2, {
22011
+ size: "2",
22012
+ weight: "bold",
22013
+ children: "Como começar"
22014
+ }), /* @__PURE__ */ jsxs(p$1, {
22015
+ direction: "column",
22016
+ gap: "1",
22017
+ mt: "2",
21909
22018
  children: [
21910
- /* @__PURE__ */ jsx(v$3, {
21911
- onSelect: () => _I("text"),
21912
- children: "Texto"
21913
- }),
21914
- /* @__PURE__ */ jsx(v$3, {
21915
- onSelect: () => _I("image"),
21916
- children: "Imagem"
22019
+ /* @__PURE__ */ jsx(p$2, {
22020
+ size: "1",
22021
+ color: "gray",
22022
+ children: "1. Adicione um elemento pelo botão acima."
21917
22023
  }),
21918
- /* @__PURE__ */ jsx(v$3, {
21919
- onSelect: () => _I("box"),
21920
- children: "Caixa (Container)"
22024
+ /* @__PURE__ */ jsx(p$2, {
22025
+ size: "1",
22026
+ color: "gray",
22027
+ children: "2. Arraste no canvas para mover e redimensionar."
21921
22028
  }),
21922
- /* @__PURE__ */ jsx(v$3, {
21923
- onSelect: () => _I("text-container"),
21924
- children: "Container com Texto"
22029
+ /* @__PURE__ */ jsx(p$2, {
22030
+ size: "1",
22031
+ color: "gray",
22032
+ children: "3. Use Camadas e Variáveis para organizar."
21925
22033
  })
21926
22034
  ]
21927
- })] }),
21928
- /* @__PURE__ */ jsxs(o, {
21929
- variant: "soft",
21930
- color: "blue",
21931
- style: {
21932
- width: "100%",
21933
- justifyContent: "center",
21934
- cursor: "pointer"
21935
- },
21936
- onClick: () => {
21937
- if (O) {
21938
- let n = {
21939
- elements: rI.elements,
21940
- isList: rI.isList,
21941
- mockData: rI.mockData,
21942
- singleMockData: rI.singleMockData,
21943
- listSettings: rI.listSettings,
21944
- canvasHeight: rI.canvasHeight
21945
- };
21946
- O(JSON.stringify(n, null, 2));
21947
- }
21948
- },
21949
- children: [/* @__PURE__ */ jsx(Share1Icon, {}), " Salvar Alterações"]
21950
- }),
21951
- /* @__PURE__ */ jsxs(p$1, {
21952
- gap: "2",
21953
- mt: "2",
21954
- children: [/* @__PURE__ */ jsxs(o, {
21955
- variant: "soft",
22035
+ })]
22036
+ }),
22037
+ j && j.length > 0 && /* @__PURE__ */ jsxs(p, {
22038
+ mt: "3",
22039
+ style: {
22040
+ backgroundColor: "var(--gray-2)",
22041
+ border: "1px solid var(--gray-4)",
22042
+ borderRadius: 12,
22043
+ padding: 12
22044
+ },
22045
+ children: [
22046
+ /* @__PURE__ */ jsx(p$2, {
22047
+ size: "2",
22048
+ weight: "bold",
22049
+ children: "Templates"
22050
+ }),
22051
+ /* @__PURE__ */ jsx(p$2, {
22052
+ size: "1",
21956
22053
  color: "gray",
21957
- style: {
21958
- flex: 1,
21959
- cursor: "pointer",
21960
- justifyContent: "center"
21961
- },
21962
- onClick: pI,
21963
- children: [/* @__PURE__ */ jsx(DownloadIcon, {}), " Exportar"]
21964
- }), /* @__PURE__ */ jsxs(o, {
21965
- variant: "soft",
22054
+ mt: "1",
22055
+ as: "div",
22056
+ children: "Selecione um template fornecido pelo sistema."
22057
+ }),
22058
+ /* @__PURE__ */ jsx(p, {
22059
+ mt: "2",
22060
+ children: /* @__PURE__ */ jsx("select", {
22061
+ value: ZF || "",
22062
+ onChange: (n) => QF(n.target.value),
22063
+ style: {
22064
+ width: "100%",
22065
+ padding: "8px",
22066
+ borderRadius: "6px",
22067
+ border: "1px solid var(--gray-6)",
22068
+ backgroundColor: "var(--gray-1)",
22069
+ color: "var(--gray-12)",
22070
+ fontSize: "14px",
22071
+ outline: "none"
22072
+ },
22073
+ children: j.map((n) => /* @__PURE__ */ jsx("option", {
22074
+ value: n.id,
22075
+ children: n.name
22076
+ }, n.id))
22077
+ })
22078
+ }),
22079
+ ZF && j.find((n) => n.id === ZF)?.description && /* @__PURE__ */ jsx(p$2, {
22080
+ size: "1",
21966
22081
  color: "gray",
22082
+ as: "div",
22083
+ mt: "2",
22084
+ children: j.find((n) => n.id === ZF)?.description
22085
+ }),
22086
+ /* @__PURE__ */ jsx(o, {
22087
+ variant: "soft",
22088
+ color: "blue",
21967
22089
  style: {
21968
- flex: 1,
22090
+ width: "100%",
22091
+ justifyContent: "center",
21969
22092
  cursor: "pointer",
21970
- justifyContent: "center"
22093
+ marginTop: "10px"
21971
22094
  },
21972
- onClick: mI,
21973
- children: [/* @__PURE__ */ jsx(UploadIcon, {}), " Importar"]
21974
- })]
21975
- }),
21976
- /* @__PURE__ */ jsx("input", {
21977
- type: "file",
21978
- ref: fI,
21979
- style: { display: "none" },
21980
- accept: ".json",
21981
- onChange: hI
22095
+ onClick: () => {
22096
+ if (!ZF) return;
22097
+ if (N) {
22098
+ N(ZF);
22099
+ return;
22100
+ }
22101
+ let n = j.find((n) => n.id === ZF);
22102
+ n && (gI(n.state), $F.current = ZF);
22103
+ },
22104
+ children: "Aplicar Template"
22105
+ })
22106
+ ]
22107
+ }),
22108
+ /* @__PURE__ */ jsx(p, {
22109
+ mt: "3",
22110
+ children: /* @__PURE__ */ jsx(EditorSettings, {})
22111
+ })
22112
+ ] })
22113
+ })
22114
+ }), /* @__PURE__ */ jsx(p, {
22115
+ p: "4",
22116
+ children: /* @__PURE__ */ jsxs(m$1, {
22117
+ defaultValue: "layers",
22118
+ children: [/* @__PURE__ */ jsxs(b$1, { children: [
22119
+ /* @__PURE__ */ jsx(P$1, {
22120
+ value: "layers",
22121
+ children: "Camadas"
22122
+ }),
22123
+ /* @__PURE__ */ jsx(P$1, {
22124
+ value: "history",
22125
+ children: "Histórico"
22126
+ }),
22127
+ /* @__PURE__ */ jsx(P$1, {
22128
+ value: "vars",
22129
+ children: "Variáveis"
22130
+ })
22131
+ ] }), /* @__PURE__ */ jsxs(p, {
22132
+ pt: "3",
22133
+ children: [
22134
+ /* @__PURE__ */ jsx(f$2, {
22135
+ value: "layers",
22136
+ children: /* @__PURE__ */ jsx(LayersPanel, { onOpenSettings: (n) => {
22137
+ W(n), Z(!0);
22138
+ } })
21982
22139
  }),
21983
- /* @__PURE__ */ jsxs(p, {
21984
- mt: "3",
21985
- style: {
21986
- backgroundColor: "var(--gray-2)",
21987
- border: "1px solid var(--gray-4)",
21988
- borderRadius: 12,
21989
- padding: 12
21990
- },
21991
- children: [/* @__PURE__ */ jsx(p$2, {
21992
- size: "2",
21993
- weight: "bold",
21994
- children: "Como começar"
21995
- }), /* @__PURE__ */ jsxs(p$1, {
21996
- direction: "column",
21997
- gap: "1",
21998
- mt: "2",
21999
- children: [
22000
- /* @__PURE__ */ jsx(p$2, {
22001
- size: "1",
22002
- color: "gray",
22003
- children: "1. Adicione um elemento pelo botão acima."
22004
- }),
22005
- /* @__PURE__ */ jsx(p$2, {
22006
- size: "1",
22007
- color: "gray",
22008
- children: "2. Arraste no canvas para mover e redimensionar."
22009
- }),
22010
- /* @__PURE__ */ jsx(p$2, {
22011
- size: "1",
22012
- color: "gray",
22013
- children: "3. Use Camadas e Variáveis para organizar."
22014
- })
22015
- ]
22016
- })]
22140
+ /* @__PURE__ */ jsx(f$2, {
22141
+ value: "history",
22142
+ children: /* @__PURE__ */ jsx(HistoryPanel, {})
22017
22143
  }),
22018
- j && j.length > 0 && /* @__PURE__ */ jsxs(p, {
22019
- mt: "3",
22020
- style: {
22021
- backgroundColor: "var(--gray-2)",
22022
- border: "1px solid var(--gray-4)",
22023
- borderRadius: 12,
22024
- padding: 12
22025
- },
22026
- children: [
22144
+ /* @__PURE__ */ jsx(f$2, {
22145
+ value: "vars",
22146
+ children: /* @__PURE__ */ jsxs(p, { children: [
22027
22147
  /* @__PURE__ */ jsx(p$2, {
22028
22148
  size: "2",
22029
22149
  weight: "bold",
22030
- children: "Templates"
22150
+ mb: "2",
22151
+ as: "div",
22152
+ children: "Variáveis Disponíveis"
22031
22153
  }),
22032
22154
  /* @__PURE__ */ jsx(p$2, {
22033
22155
  size: "1",
22034
22156
  color: "gray",
22035
- mt: "1",
22157
+ mb: "2",
22036
22158
  as: "div",
22037
- children: "Selecione um template fornecido pelo sistema."
22159
+ children: "Clique para copiar ou arraste"
22038
22160
  }),
22039
- /* @__PURE__ */ jsx(p, {
22040
- mt: "2",
22041
- children: /* @__PURE__ */ jsx("select", {
22042
- value: ZF || "",
22043
- onChange: (n) => QF(n.target.value),
22161
+ /* @__PURE__ */ jsxs(p$1, {
22162
+ direction: "column",
22163
+ gap: "2",
22164
+ children: [n.props.map((n, _) => /* @__PURE__ */ jsxs(e, {
22165
+ color: "blue",
22166
+ variant: "soft",
22167
+ size: "2",
22044
22168
  style: {
22045
- width: "100%",
22046
22169
  padding: "8px",
22047
- borderRadius: "6px",
22048
- border: "1px solid var(--gray-6)",
22049
- backgroundColor: "var(--gray-1)",
22050
- color: "var(--gray-12)",
22051
- fontSize: "14px",
22052
- outline: "none"
22170
+ justifyContent: "flex-start",
22171
+ cursor: "grab"
22053
22172
  },
22054
- children: j.map((n) => /* @__PURE__ */ jsx("option", {
22055
- value: n.id,
22056
- children: n.name
22057
- }, n.id))
22058
- })
22059
- }),
22060
- ZF && j.find((n) => n.id === ZF)?.description && /* @__PURE__ */ jsx(p$2, {
22061
- size: "1",
22062
- color: "gray",
22063
- as: "div",
22064
- mt: "2",
22065
- children: j.find((n) => n.id === ZF)?.description
22066
- }),
22067
- /* @__PURE__ */ jsx(o, {
22068
- variant: "soft",
22069
- color: "blue",
22070
- style: {
22071
- width: "100%",
22072
- justifyContent: "center",
22073
- cursor: "pointer",
22074
- marginTop: "10px"
22075
- },
22076
- onClick: () => {
22077
- if (!ZF) return;
22078
- if (N) {
22079
- N(ZF);
22080
- return;
22081
- }
22082
- let n = j.find((n) => n.id === ZF);
22083
- n && (gI(n.state), $F.current = ZF);
22084
- },
22085
- children: "Aplicar Template"
22086
- })
22087
- ]
22088
- }),
22089
- /* @__PURE__ */ jsx(p, {
22090
- mt: "3",
22091
- children: /* @__PURE__ */ jsx(EditorSettings, {})
22092
- })
22093
- ] })
22094
- })
22095
- }), /* @__PURE__ */ jsx(p, {
22096
- p: "4",
22097
- children: /* @__PURE__ */ jsxs(m$1, {
22098
- defaultValue: "layers",
22099
- children: [/* @__PURE__ */ jsxs(b$1, { children: [
22100
- /* @__PURE__ */ jsx(P$1, {
22101
- value: "layers",
22102
- children: "Camadas"
22103
- }),
22104
- /* @__PURE__ */ jsx(P$1, {
22105
- value: "history",
22106
- children: "Histórico"
22107
- }),
22108
- /* @__PURE__ */ jsx(P$1, {
22109
- value: "vars",
22110
- children: "Variáveis"
22111
- })
22112
- ] }), /* @__PURE__ */ jsxs(p, {
22113
- pt: "3",
22114
- children: [
22115
- /* @__PURE__ */ jsx(f$2, {
22116
- value: "layers",
22117
- children: /* @__PURE__ */ jsx(LayersPanel, { onOpenSettings: (n) => {
22118
- W(n), Z(!0);
22119
- } })
22120
- }),
22121
- /* @__PURE__ */ jsx(f$2, {
22122
- value: "history",
22123
- children: /* @__PURE__ */ jsx(HistoryPanel, {})
22124
- }),
22125
- /* @__PURE__ */ jsx(f$2, {
22126
- value: "vars",
22127
- children: /* @__PURE__ */ jsxs(p, { children: [
22128
- /* @__PURE__ */ jsx(p$2, {
22129
- size: "2",
22130
- weight: "bold",
22131
- mb: "2",
22132
- as: "div",
22133
- children: "Variáveis Disponíveis"
22134
- }),
22135
- /* @__PURE__ */ jsx(p$2, {
22136
- size: "1",
22137
- color: "gray",
22138
- mb: "2",
22139
- as: "div",
22140
- children: "Clique para copiar ou arraste"
22141
- }),
22142
- /* @__PURE__ */ jsxs(p$1, {
22143
- direction: "column",
22144
- gap: "2",
22145
- children: [n.props.map((n, _) => /* @__PURE__ */ jsxs(e, {
22146
- color: "blue",
22147
- variant: "soft",
22148
- size: "2",
22173
+ title: `Clique para copiar {{${n.dataName}}}`,
22174
+ draggable: !0,
22175
+ onDragStart: (_) => {
22176
+ _.dataTransfer.setData("application/x-editor-prop", n.dataName), _.dataTransfer.effectAllowed = "copy";
22177
+ },
22178
+ onClick: () => {
22179
+ let _ = `{{${n.dataName}}}`;
22180
+ navigator.clipboard.writeText(_);
22181
+ },
22182
+ children: [n.name, /* @__PURE__ */ jsx(p$2, {
22183
+ color: "gray",
22149
22184
  style: {
22150
- padding: "8px",
22151
- justifyContent: "flex-start",
22152
- cursor: "grab"
22153
- },
22154
- title: `Clique para copiar {{${n.dataName}}}`,
22155
- draggable: !0,
22156
- onDragStart: (_) => {
22157
- _.dataTransfer.setData("application/x-editor-prop", n.dataName), _.dataTransfer.effectAllowed = "copy";
22158
- },
22159
- onClick: () => {
22160
- let _ = `{{${n.dataName}}}`;
22161
- navigator.clipboard.writeText(_);
22185
+ marginLeft: "auto",
22186
+ fontSize: "10px"
22162
22187
  },
22163
- children: [n.name, /* @__PURE__ */ jsx(p$2, {
22164
- color: "gray",
22165
- style: {
22166
- marginLeft: "auto",
22167
- fontSize: "10px"
22168
- },
22169
- children: `{{${n.dataName}}}`
22170
- })]
22171
- }, _)), n.props.length === 0 && /* @__PURE__ */ jsx(p$2, {
22172
- size: "1",
22173
- color: "gray",
22174
- style: { fontStyle: "italic" },
22175
- children: "Nenhuma variável configurada."
22188
+ children: `{{${n.dataName}}}`
22176
22189
  })]
22177
- })
22178
- ] })
22179
- })
22180
- ]
22181
- })]
22182
- })
22183
- })]
22184
- })
22190
+ }, _)), n.props.length === 0 && /* @__PURE__ */ jsx(p$2, {
22191
+ size: "1",
22192
+ color: "gray",
22193
+ style: { fontStyle: "italic" },
22194
+ children: "Nenhuma variável configurada."
22195
+ })]
22196
+ })
22197
+ ] })
22198
+ })
22199
+ ]
22200
+ })]
22201
+ })
22202
+ })]
22185
22203
  })
22186
- }), /* @__PURE__ */ jsxs(p$1, {
22187
- direction: "column",
22204
+ })]
22205
+ }), /* @__PURE__ */ jsxs(p$1, {
22206
+ direction: "column",
22207
+ style: {
22208
+ flex: 1,
22209
+ height: "100%",
22210
+ overflow: "hidden"
22211
+ },
22212
+ children: [/* @__PURE__ */ jsxs(p$1, {
22213
+ justify: "between",
22214
+ align: "center",
22215
+ px: "3",
22216
+ py: "2",
22188
22217
  style: {
22189
- flex: 1,
22190
- height: "100%",
22191
- overflow: "hidden"
22218
+ borderBottom: "1px solid var(--gray-6)",
22219
+ backgroundColor: "var(--gray-1)",
22220
+ flexShrink: 0,
22221
+ zIndex: 10
22192
22222
  },
22193
- children: [/* @__PURE__ */ jsxs(p$1, {
22194
- justify: "between",
22223
+ children: [/* @__PURE__ */ jsx(p$1, {
22224
+ gap: "3",
22195
22225
  align: "center",
22196
- px: "3",
22197
- py: "2",
22198
- style: {
22199
- borderBottom: "1px solid var(--gray-6)",
22200
- backgroundColor: "var(--gray-1)",
22201
- flexShrink: 0,
22202
- zIndex: 10
22203
- },
22204
- children: [/* @__PURE__ */ jsx(p$1, {
22205
- gap: "3",
22206
- align: "center",
22207
- children: /* @__PURE__ */ jsx(o$2, {
22208
- size: "2",
22209
- variant: "ghost",
22210
- color: "gray",
22211
- onClick: () => H(!B),
22212
- title: B ? "Ocultar Barra Lateral" : "Mostrar Barra Lateral",
22213
- style: { cursor: "pointer" },
22214
- children: jsx(B ? DoubleArrowLeftIcon : DoubleArrowRightIcon, {})
22215
- })
22216
- }), /* @__PURE__ */ jsxs(p$1, {
22217
- gap: "3",
22218
- align: "center",
22219
- children: [/* @__PURE__ */ jsx(ShortcutsDialog, {}), /* @__PURE__ */ jsx(o$2, {
22220
- size: "2",
22221
- variant: "ghost",
22222
- color: P ? "blue" : "gray",
22223
- onClick: () => z(!P),
22224
- title: P ? "Ocultar Preview" : "Mostrar Preview",
22225
- style: { cursor: "pointer" },
22226
- children: jsx(P ? EyeOpenIcon : EyeNoneIcon, {})
22227
- })]
22226
+ children: /* @__PURE__ */ jsx(o$2, {
22227
+ size: "2",
22228
+ variant: "ghost",
22229
+ color: "gray",
22230
+ onClick: () => H(!B),
22231
+ title: B ? "Ocultar Barra Lateral" : "Mostrar Barra Lateral",
22232
+ style: { cursor: "pointer" },
22233
+ children: jsx(B ? DoubleArrowLeftIcon : DoubleArrowRightIcon, {})
22234
+ })
22235
+ }), /* @__PURE__ */ jsxs(p$1, {
22236
+ gap: "3",
22237
+ align: "center",
22238
+ children: [/* @__PURE__ */ jsx(ShortcutsDialog, {}), /* @__PURE__ */ jsx(o$2, {
22239
+ size: "2",
22240
+ variant: "ghost",
22241
+ color: P ? "blue" : "gray",
22242
+ onClick: () => z(!P),
22243
+ title: P ? "Ocultar Preview" : "Mostrar Preview",
22244
+ style: { cursor: "pointer" },
22245
+ children: jsx(P ? EyeOpenIcon : EyeNoneIcon, {})
22228
22246
  })]
22229
- }), /* @__PURE__ */ jsx(p, {
22247
+ })]
22248
+ }), /* @__PURE__ */ jsx(p, {
22249
+ style: {
22250
+ flex: 1,
22251
+ position: "relative",
22252
+ overflow: "hidden"
22253
+ },
22254
+ children: /* @__PURE__ */ jsxs(Rt, {
22255
+ orientation: "horizontal",
22230
22256
  style: {
22231
- flex: 1,
22232
- position: "relative",
22233
- overflow: "hidden"
22257
+ height: "100%",
22258
+ width: "100%"
22234
22259
  },
22235
- children: /* @__PURE__ */ jsxs(Rt, {
22236
- orientation: "horizontal",
22237
- style: {
22238
- height: "100%",
22239
- width: "100%"
22240
- },
22241
- children: [
22242
- /* @__PURE__ */ jsx(kt, {
22243
- defaultSize: 50,
22244
- minSize: 20,
22245
- children: /* @__PURE__ */ jsxs(o$1, {
22246
- columns: "20px 1fr",
22247
- rows: "20px 1fr",
22248
- style: {
22249
- height: "100%",
22250
- width: "100%",
22251
- backgroundColor: "var(--color-background)"
22252
- },
22253
- children: [
22254
- /* @__PURE__ */ jsx(p, { style: {
22260
+ children: [
22261
+ (!YF || !P) && /* @__PURE__ */ jsx(kt, {
22262
+ defaultSize: 50,
22263
+ minSize: 20,
22264
+ children: /* @__PURE__ */ jsxs(o$1, {
22265
+ columns: "20px 1fr",
22266
+ rows: "20px 1fr",
22267
+ style: {
22268
+ height: "100%",
22269
+ width: "100%",
22270
+ backgroundColor: "var(--color-background)"
22271
+ },
22272
+ children: [
22273
+ /* @__PURE__ */ jsx(p, { style: {
22274
+ backgroundColor: "var(--gray-2)",
22275
+ borderRight: "1px solid var(--gray-6)",
22276
+ borderBottom: "1px solid var(--gray-6)",
22277
+ zIndex: 30
22278
+ } }),
22279
+ /* @__PURE__ */ jsx(p, {
22280
+ style: {
22255
22281
  backgroundColor: "var(--gray-2)",
22256
- borderRight: "1px solid var(--gray-6)",
22257
22282
  borderBottom: "1px solid var(--gray-6)",
22283
+ overflow: "hidden",
22258
22284
  zIndex: 30
22259
- } }),
22260
- /* @__PURE__ */ jsx(p, {
22261
- style: {
22262
- backgroundColor: "var(--gray-2)",
22263
- borderBottom: "1px solid var(--gray-6)",
22264
- overflow: "hidden",
22265
- zIndex: 30
22266
- },
22267
- children: /* @__PURE__ */ jsx(Ruler, { orientation: "horizontal" })
22268
- }),
22269
- /* @__PURE__ */ jsx(p, {
22270
- style: {
22271
- backgroundColor: "var(--gray-2)",
22272
- borderRight: "1px solid var(--gray-6)",
22273
- overflow: "hidden",
22274
- zIndex: 30
22275
- },
22276
- children: /* @__PURE__ */ jsx(Ruler, { orientation: "vertical" })
22277
- }),
22278
- /* @__PURE__ */ jsxs(p, {
22279
- style: {
22280
- position: "relative",
22281
- overflow: "hidden",
22282
- width: "100%",
22283
- height: "100%"
22284
- },
22285
- children: [
22286
- /* @__PURE__ */ jsx(p, {
22287
- style: {
22288
- position: "absolute",
22289
- top: 16,
22290
- left: "50%",
22291
- transform: "translateX(-50%)",
22292
- zIndex: 20
22293
- },
22294
- children: /* @__PURE__ */ jsx(AlignmentToolbar, {})
22295
- }),
22296
- /* @__PURE__ */ jsx(p, {
22297
- style: {
22298
- position: "absolute",
22299
- bottom: 16,
22300
- right: 16,
22301
- zIndex: 20
22302
- },
22303
- children: /* @__PURE__ */ jsx(ViewToolbar, {})
22304
- }),
22305
- /* @__PURE__ */ jsx(Canvas, {}),
22306
- /* @__PURE__ */ jsx(Minimap, {})
22307
- ]
22308
- })
22309
- ]
22310
- })
22311
- }),
22312
- P && /* @__PURE__ */ jsx(Ot, { style: {
22313
- width: "4px",
22314
- backgroundColor: "var(--gray-6)",
22315
- cursor: "col-resize",
22316
- transition: "background-color 0.2s"
22317
- } }),
22318
- P && /* @__PURE__ */ jsx(kt, {
22319
- defaultSize: 50,
22320
- minSize: 20,
22321
- children: /* @__PURE__ */ jsx(p, {
22322
- style: {
22323
- height: "100%",
22324
- width: "100%",
22325
- backgroundColor: "var(--gray-3)",
22326
- borderLeft: "1px solid var(--gray-5)"
22327
- },
22328
- children: /* @__PURE__ */ jsx(Preview, {})
22329
- })
22285
+ },
22286
+ children: /* @__PURE__ */ jsx(Ruler, { orientation: "horizontal" })
22287
+ }),
22288
+ /* @__PURE__ */ jsx(p, {
22289
+ style: {
22290
+ backgroundColor: "var(--gray-2)",
22291
+ borderRight: "1px solid var(--gray-6)",
22292
+ overflow: "hidden",
22293
+ zIndex: 30
22294
+ },
22295
+ children: /* @__PURE__ */ jsx(Ruler, { orientation: "vertical" })
22296
+ }),
22297
+ /* @__PURE__ */ jsxs(p, {
22298
+ style: {
22299
+ position: "relative",
22300
+ overflow: "hidden",
22301
+ width: "100%",
22302
+ height: "100%"
22303
+ },
22304
+ children: [
22305
+ /* @__PURE__ */ jsx(p, {
22306
+ style: {
22307
+ position: "absolute",
22308
+ top: 16,
22309
+ left: "50%",
22310
+ transform: "translateX(-50%)",
22311
+ zIndex: 20
22312
+ },
22313
+ children: /* @__PURE__ */ jsx(AlignmentToolbar, {})
22314
+ }),
22315
+ /* @__PURE__ */ jsx(p, {
22316
+ style: {
22317
+ position: "absolute",
22318
+ bottom: 16,
22319
+ right: 16,
22320
+ zIndex: 20
22321
+ },
22322
+ children: /* @__PURE__ */ jsx(ViewToolbar, {})
22323
+ }),
22324
+ /* @__PURE__ */ jsx(Canvas, {}),
22325
+ /* @__PURE__ */ jsx(Minimap, {})
22326
+ ]
22327
+ })
22328
+ ]
22330
22329
  })
22331
- ]
22332
- })
22333
- })]
22330
+ }),
22331
+ !YF && P && /* @__PURE__ */ jsx(Ot, { style: {
22332
+ width: "4px",
22333
+ backgroundColor: "var(--gray-6)",
22334
+ cursor: "col-resize",
22335
+ transition: "background-color 0.2s"
22336
+ } }),
22337
+ P && /* @__PURE__ */ jsx(kt, {
22338
+ defaultSize: 50,
22339
+ minSize: 20,
22340
+ children: /* @__PURE__ */ jsx(p, {
22341
+ style: {
22342
+ height: "100%",
22343
+ width: "100%",
22344
+ backgroundColor: "var(--gray-3)",
22345
+ borderLeft: "1px solid var(--gray-5)"
22346
+ },
22347
+ children: /* @__PURE__ */ jsx(Preview, {})
22348
+ })
22349
+ })
22350
+ ]
22351
+ })
22334
22352
  })]
22335
- }),
22336
- U && /* @__PURE__ */ jsx(ElementAdvancedSettings, {
22337
- elementId: U,
22338
- open: G,
22339
- onOpenChange: Z
22340
- }),
22341
- /* @__PURE__ */ jsx(s$4, {
22342
- open: YF,
22343
- children: /* @__PURE__ */ jsxs(p$8, {
22344
- style: { maxWidth: 450 },
22345
- children: [/* @__PURE__ */ jsx(g$2, { children: "Dispositivo Não Suportado" }), /* @__PURE__ */ jsx(m$3, {
22346
- size: "2",
22347
- children: "Por favor, utilize um computador ou tablet para acessar o editor. O sistema não foi desenvolvido para celulares."
22348
- })]
22349
- })
22350
- })
22351
- ]
22353
+ })]
22354
+ }), U && /* @__PURE__ */ jsx(ElementAdvancedSettings, {
22355
+ elementId: U,
22356
+ open: G,
22357
+ onOpenChange: Z
22358
+ })]
22352
22359
  });
22353
22360
  };
22354
22361
  const GenericEditor = (n) => /* @__PURE__ */ jsx(EditorProvider, {