@tecof/theme-editor 0.0.9 → 0.0.12

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.mts CHANGED
@@ -157,7 +157,8 @@ interface LinkFieldValue {
157
157
  declare class TecofApiClient {
158
158
  private apiUrl;
159
159
  private secretKey;
160
- constructor(apiUrl: string, secretKey: string);
160
+ private customCdnUrl?;
161
+ constructor(apiUrl: string, secretKey: string, customCdnUrl?: string);
161
162
  private get headers();
162
163
  /**
163
164
  * Fetch a page by ID (for the editor)
@@ -197,7 +198,7 @@ declare class TecofApiClient {
197
198
  code: string;
198
199
  value: string;
199
200
  }[]>>;
200
- /** CDN base URL (derived from apiUrl) */
201
+ /** CDN base URL (defaults to apiUrl if not set) */
201
202
  get cdnUrl(): string;
202
203
  }
203
204
 
@@ -205,8 +206,9 @@ interface TecofContextValue {
205
206
  apiClient: TecofApiClient;
206
207
  secretKey: string;
207
208
  apiUrl: string;
209
+ cdnUrl?: string;
208
210
  }
209
- declare const TecofProvider: ({ apiUrl, secretKey, children }: TecofProviderProps) => react_jsx_runtime.JSX.Element;
211
+ declare const TecofProvider: ({ apiUrl, secretKey, cdnUrl, children }: TecofProviderProps) => react_jsx_runtime.JSX.Element;
210
212
  declare function useTecof(): TecofContextValue;
211
213
 
212
214
  /**
package/dist/index.d.ts CHANGED
@@ -157,7 +157,8 @@ interface LinkFieldValue {
157
157
  declare class TecofApiClient {
158
158
  private apiUrl;
159
159
  private secretKey;
160
- constructor(apiUrl: string, secretKey: string);
160
+ private customCdnUrl?;
161
+ constructor(apiUrl: string, secretKey: string, customCdnUrl?: string);
161
162
  private get headers();
162
163
  /**
163
164
  * Fetch a page by ID (for the editor)
@@ -197,7 +198,7 @@ declare class TecofApiClient {
197
198
  code: string;
198
199
  value: string;
199
200
  }[]>>;
200
- /** CDN base URL (derived from apiUrl) */
201
+ /** CDN base URL (defaults to apiUrl if not set) */
201
202
  get cdnUrl(): string;
202
203
  }
203
204
 
@@ -205,8 +206,9 @@ interface TecofContextValue {
205
206
  apiClient: TecofApiClient;
206
207
  secretKey: string;
207
208
  apiUrl: string;
209
+ cdnUrl?: string;
208
210
  }
209
- declare const TecofProvider: ({ apiUrl, secretKey, children }: TecofProviderProps) => react_jsx_runtime.JSX.Element;
211
+ declare const TecofProvider: ({ apiUrl, secretKey, cdnUrl, children }: TecofProviderProps) => react_jsx_runtime.JSX.Element;
210
212
  declare function useTecof(): TecofContextValue;
211
213
 
212
214
  /**
package/dist/index.js CHANGED
@@ -64,9 +64,10 @@ var ReactDOM__namespace = /*#__PURE__*/_interopNamespace(ReactDOM);
64
64
 
65
65
  // src/api.ts
66
66
  var TecofApiClient = class {
67
- constructor(apiUrl, secretKey) {
67
+ constructor(apiUrl, secretKey, customCdnUrl) {
68
68
  this.apiUrl = apiUrl.replace(/\/+$/, "");
69
69
  this.secretKey = secretKey;
70
+ this.customCdnUrl = customCdnUrl ? customCdnUrl.replace(/\/+$/, "") : void 0;
70
71
  }
71
72
  get headers() {
72
73
  return {
@@ -227,20 +228,21 @@ var TecofApiClient = class {
227
228
  };
228
229
  }
229
230
  }
230
- /** CDN base URL (derived from apiUrl) */
231
+ /** CDN base URL (defaults to apiUrl if not set) */
231
232
  get cdnUrl() {
232
- return this.apiUrl;
233
+ return this.customCdnUrl || this.apiUrl;
233
234
  }
234
235
  };
235
236
  var TecofContext = React__default.createContext(null);
236
- var TecofProvider = ({ apiUrl, secretKey, children }) => {
237
+ var TecofProvider = ({ apiUrl, secretKey, cdnUrl, children }) => {
237
238
  const value = React__default.useMemo(
238
239
  () => ({
239
- apiClient: new TecofApiClient(apiUrl, secretKey),
240
+ apiClient: new TecofApiClient(apiUrl, secretKey, cdnUrl),
240
241
  secretKey,
241
- apiUrl
242
+ apiUrl,
243
+ cdnUrl
242
244
  }),
243
- [apiUrl, secretKey]
245
+ [apiUrl, secretKey, cdnUrl]
244
246
  );
245
247
  return /* @__PURE__ */ jsxRuntime.jsx(TecofContext.Provider, { value, children });
246
248
  };
@@ -1045,7 +1047,7 @@ var createLanguageField = (options = {}) => {
1045
1047
  label,
1046
1048
  labelIcon,
1047
1049
  visible,
1048
- render: ({ value, onChange, readOnly, field, name: name3, id }) => /* @__PURE__ */ jsxRuntime.jsx(
1050
+ render: ({ value, onChange, readOnly, field, name: name3, id }) => /* @__PURE__ */ jsxRuntime.jsx(core.FieldLabel, { label: label || "", icon: labelIcon, readOnly, children: /* @__PURE__ */ jsxRuntime.jsx(
1049
1051
  LanguageField,
1050
1052
  {
1051
1053
  field,
@@ -1056,7 +1058,7 @@ var createLanguageField = (options = {}) => {
1056
1058
  readOnly,
1057
1059
  ...fieldOptions
1058
1060
  }
1059
- )
1061
+ ) })
1060
1062
  };
1061
1063
  };
1062
1064
  var createExtensions = () => [
@@ -1335,7 +1337,7 @@ var createEditorField = (options = {}) => {
1335
1337
  label,
1336
1338
  labelIcon,
1337
1339
  visible,
1338
- render: ({ value, onChange, readOnly, field, name: name3, id }) => /* @__PURE__ */ jsxRuntime.jsx(
1340
+ render: ({ value, onChange, readOnly, field, name: name3, id }) => /* @__PURE__ */ jsxRuntime.jsx(core.FieldLabel, { label: label || "", icon: labelIcon, readOnly, children: /* @__PURE__ */ jsxRuntime.jsx(
1339
1341
  EditorField,
1340
1342
  {
1341
1343
  field,
@@ -1346,7 +1348,7 @@ var createEditorField = (options = {}) => {
1346
1348
  readOnly,
1347
1349
  ...fieldOptions
1348
1350
  }
1349
- )
1351
+ ) })
1350
1352
  };
1351
1353
  };
1352
1354
 
@@ -20810,6 +20812,8 @@ var Root = Dialog;
20810
20812
  var Portal2 = DialogPortal;
20811
20813
  var Overlay = DialogOverlay;
20812
20814
  var Content = DialogContent;
20815
+ var Title = DialogTitle;
20816
+ var Description = DialogDescription;
20813
20817
  function __insertCSS(code) {
20814
20818
  if (typeof document == "undefined") return;
20815
20819
  let head = document.head || document.getElementsByTagName("head")[0];
@@ -22271,7 +22275,10 @@ var Drawer = {
22271
22275
  Root: Root2,
22272
22276
  Content: Content2,
22273
22277
  Overlay: Overlay2,
22274
- Portal: Portal3};
22278
+ Portal: Portal3,
22279
+ Title,
22280
+ Description
22281
+ };
22275
22282
  registerPlugin(
22276
22283
  filepond_plugin_file_validate_size_esm_default,
22277
22284
  filepond_plugin_file_validate_type_esm_default,
@@ -22714,6 +22721,8 @@ var UploadField = ({
22714
22721
  }, children: /* @__PURE__ */ jsxRuntime.jsxs(Drawer.Portal, { children: [
22715
22722
  /* @__PURE__ */ jsxRuntime.jsx(Drawer.Overlay, { className: "tecof-upload-drawer-overlay" }),
22716
22723
  /* @__PURE__ */ jsxRuntime.jsxs(Drawer.Content, { className: "tecof-upload-drawer-content", children: [
22724
+ /* @__PURE__ */ jsxRuntime.jsx(Drawer.Title, { className: "tecof-sr-only", children: "Medya Y\xF6neticisi" }),
22725
+ /* @__PURE__ */ jsxRuntime.jsx(Drawer.Description, { className: "tecof-sr-only", children: "Sunucudaki dosyalardan birini se\xE7in veya yeni dosya y\xFCkleyin" }),
22717
22726
  /* @__PURE__ */ jsxRuntime.jsx("div", { className: "tecof-upload-drawer-handle" }),
22718
22727
  /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "tecof-upload-drawer-inner", children: [
22719
22728
  /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "tecof-upload-drawer-header", children: [
@@ -22807,7 +22816,7 @@ var createUploadField = (options = {}) => {
22807
22816
  label,
22808
22817
  labelIcon,
22809
22818
  visible,
22810
- render: ({ value, onChange, readOnly, field, name: name3, id }) => /* @__PURE__ */ jsxRuntime.jsx(
22819
+ render: ({ value, onChange, readOnly, field, name: name3, id }) => /* @__PURE__ */ jsxRuntime.jsx(core.FieldLabel, { label: label || "", icon: labelIcon, readOnly, children: /* @__PURE__ */ jsxRuntime.jsx(
22811
22820
  UploadField,
22812
22821
  {
22813
22822
  field,
@@ -22818,7 +22827,7 @@ var createUploadField = (options = {}) => {
22818
22827
  readOnly,
22819
22828
  ...fieldOptions
22820
22829
  }
22821
- )
22830
+ ) })
22822
22831
  };
22823
22832
  };
22824
22833
 
@@ -23496,7 +23505,7 @@ var createCodeEditorField = (options = {}) => {
23496
23505
  label,
23497
23506
  labelIcon,
23498
23507
  visible,
23499
- render: ({ value, onChange, readOnly, field, name: name3, id }) => /* @__PURE__ */ jsxRuntime.jsx(
23508
+ render: ({ value, onChange, readOnly, field, name: name3, id }) => /* @__PURE__ */ jsxRuntime.jsx(core.FieldLabel, { label: label || "", icon: labelIcon, readOnly, children: /* @__PURE__ */ jsxRuntime.jsx(
23500
23509
  CodeEditorField,
23501
23510
  {
23502
23511
  field,
@@ -23507,7 +23516,7 @@ var createCodeEditorField = (options = {}) => {
23507
23516
  readOnly,
23508
23517
  ...fieldOptions
23509
23518
  }
23510
- )
23519
+ ) })
23511
23520
  };
23512
23521
  };
23513
23522
  var LinkField = ({
@@ -23646,6 +23655,8 @@ var LinkField = ({
23646
23655
  /* @__PURE__ */ jsxRuntime.jsx(Drawer.Root, { open: drawerOpen, onOpenChange: setDrawerOpen, children: /* @__PURE__ */ jsxRuntime.jsxs(Drawer.Portal, { children: [
23647
23656
  /* @__PURE__ */ jsxRuntime.jsx(Drawer.Overlay, { className: "tecof-link-drawer-overlay" }),
23648
23657
  /* @__PURE__ */ jsxRuntime.jsxs(Drawer.Content, { className: "tecof-link-drawer-content", children: [
23658
+ /* @__PURE__ */ jsxRuntime.jsx(Drawer.Title, { className: "tecof-sr-only", children: "Ba\u011Flant\u0131 Sayfas\u0131 Se\xE7ici" }),
23659
+ /* @__PURE__ */ jsxRuntime.jsx(Drawer.Description, { className: "tecof-sr-only", children: "Sayfa listesinden se\xE7im yap\u0131n veya arama yap\u0131n" }),
23649
23660
  /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "tecof-link-drawer-header", children: [
23650
23661
  /* @__PURE__ */ jsxRuntime.jsx("h2", { className: "tecof-link-drawer-title", children: "Sayfa Se\xE7" }),
23651
23662
  /* @__PURE__ */ jsxRuntime.jsx("button", { className: "tecof-link-drawer-close-btn", onClick: () => setDrawerOpen(false), children: /* @__PURE__ */ jsxRuntime.jsx(X, { size: 16 }) })
@@ -23697,18 +23708,18 @@ var createLinkField = (options = {}) => {
23697
23708
  label,
23698
23709
  labelIcon,
23699
23710
  visible,
23700
- render: ({ value, onChange, readOnly, field, name: name3, id }) => /* @__PURE__ */ jsxRuntime.jsx(
23711
+ render: ({ value, onChange, readOnly, field, name: name3, id }) => /* @__PURE__ */ jsxRuntime.jsx(core.FieldLabel, { label: label || "", icon: labelIcon, readOnly, children: /* @__PURE__ */ jsxRuntime.jsx(
23701
23712
  LinkField,
23702
23713
  {
23703
23714
  field,
23704
23715
  name: name3,
23705
23716
  id,
23706
- value: value || null,
23717
+ value: value || { url: "" },
23707
23718
  onChange,
23708
23719
  readOnly,
23709
23720
  ...fieldOptions
23710
23721
  }
23711
- )
23722
+ ) })
23712
23723
  };
23713
23724
  };
23714
23725
  var PRESET_COLORS = [
@@ -23972,7 +23983,7 @@ var createColorField = (options = {}) => {
23972
23983
  label,
23973
23984
  labelIcon,
23974
23985
  visible,
23975
- render: ({ value, onChange, readOnly, field, name: name3, id }) => /* @__PURE__ */ jsxRuntime.jsx(
23986
+ render: ({ value, onChange, readOnly, field, name: name3, id }) => /* @__PURE__ */ jsxRuntime.jsx(core.FieldLabel, { label: label || "", icon: labelIcon, readOnly, children: /* @__PURE__ */ jsxRuntime.jsx(
23976
23987
  ColorField,
23977
23988
  {
23978
23989
  field,
@@ -23983,7 +23994,7 @@ var createColorField = (options = {}) => {
23983
23994
  readOnly,
23984
23995
  ...fieldOptions
23985
23996
  }
23986
- )
23997
+ ) })
23987
23998
  };
23988
23999
  };
23989
24000