@bettercms-ai/sdk 1.30.1 → 1.31.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.d.cts CHANGED
@@ -768,6 +768,15 @@ interface ManagedComponent {
768
768
  thumbnail?: string | null;
769
769
  /** How an instance reads as a row in a parent's slot list. @see ComponentPreview */
770
770
  preview?: ComponentPreview | null;
771
+ /** The block icon (a /kit schema's document-level `icon`), a dock icon name. */
772
+ icon?: string | null;
773
+ /** The /kit tabs no top-level prop sits in (declared, empty). @see ComponentTab */
774
+ tabs?: Array<{
775
+ id: string;
776
+ label: string;
777
+ icon?: string;
778
+ order?: number;
779
+ }> | null;
771
780
  /** Send it back as `ifMatch` on updateComponent. */
772
781
  optimisticVersion?: number;
773
782
  }
@@ -789,6 +798,15 @@ interface ManagedComponentInput {
789
798
  description?: string;
790
799
  /** title/subtitle/media name top-level prop keys (422 `preview_key_unknown` otherwise); null clears it. */
791
800
  preview?: ComponentPreview | null;
801
+ /** The block icon, a dock icon name (bettercms://icons/dock); null clears it. */
802
+ icon?: string | null;
803
+ /** /kit tabs no top-level prop sits in; null clears them (422 component_tab_invalid on a prop's own tab). */
804
+ tabs?: Array<{
805
+ id: string;
806
+ label: string;
807
+ icon?: string;
808
+ order?: number;
809
+ }> | null;
792
810
  blockJson?: unknown[];
793
811
  props?: unknown[];
794
812
  /**
@@ -1429,6 +1447,16 @@ declare function plain(value: TextOrRich): string;
1429
1447
  * alone, so a body field still renders as a document.
1430
1448
  */
1431
1449
  declare function rich(value: TextOrRich, fallback?: string): string;
1450
+ /**
1451
+ * Renderable HTML for a ONE-LINE place: a heading, a button, a caption. `rich()`, except that several
1452
+ * paragraphs are that place's LINES, joined with `<br>` (a heading-styled first block counts as one).
1453
+ *
1454
+ * An author who presses Enter in a heading's editor stores a second paragraph. `rich()` leaves it a
1455
+ * paragraph, and `<h1><p>…</p><p>…</p></h1>` is what the build then draws, while a publish between
1456
+ * builds writes the same value into the built heading as lines. This draws what the publish draws.
1457
+ * A value holding anything else (a list, an image, a table) is returned as `rich()` returns it.
1458
+ */
1459
+ declare function lines(value: TextOrRich, fallback?: string): string;
1432
1460
 
1433
1461
  /**
1434
1462
  * resolveSeo — framework-agnostic page-over-site SEO merge for headless consumers.
@@ -1900,4 +1928,29 @@ interface WebhookListResponse {
1900
1928
  };
1901
1929
  }
1902
1930
 
1903
- export { type AddPageFieldsInput, type ApiKeyUsage, type ApiKeyWithRaw, type AuthResult, BetterCMSError as BCMSClientError, ErrorCodes as BCMSErrorCodes, BetterCMS, BetterCMSAdminClient, type BetterCMSAdminOptions, BetterCMSDeliveryClient, BetterCMSError, BetterCMSManagementClient, type BetterCMSManagementOptions, type BetterCMSReadClient, type BetterCMSSiteOptions, CONTENT_APPLIED, type CommandManagedLayoutInput, type ContentAppliedMessage, type CreateApiKeyInput, type CreateClientOptions, type CreateEntryInput, type CreateFormInput, type CreateManagedPageInput, type CreateModelInput, type CreatePageInput, type CreateWebhookInput, type CreateWorkspaceInput, type DeliveryForm, type DeliveryFormField, type DeliveryFormFieldType, ErrorCodes, type ExtractionCandidate, type FormFieldInput, type FormListOptions, type FormSubmitError, type FormValue, type FormValues, type GetEntryOptions, type GetManagedLayoutOptions, type ListContentAllOptions, type ListContentOptions, type ListEntriesFilter, type ListEntriesOptions, type ListPagesOptions, type ManagedComponent, type ManagedComponentInput, type ManagedComponentSummary, type ManagedContentEntry, type ManagedContentModel, type ManagedForm, type ManagedFormInput, type ManagedLayoutClient, type ManagedLayoutDocument, type ManagedMediaAsset, type ManagedPage, type ManagementClient, type MediaListOptions, type MediaMetadata, type Member, type MemberRole, type ModelFieldset, PORTABLE_TEXT_FORMAT, type PageCreateReport, type PageListOptions, type PendingInvite, type PublishManagedLayoutInput, type PublishedContent, type ResolvedSeo, type RichTextValue, STEGA_OPEN, type SearchHit, type SearchOptions, type SeoInput, type SeoLocation, type SeoMeta, type SeoMetaInput, type SetPageContentInput, type StegaNode, type StegaPayload, type SubmissionListOptions, type SubmitFormOptions, type SubmitFormResult, type TextOrRich, type UpdateApiKeyInput, type UpdateAssetInput, type UpdateEntryInput, type UpdateFormInput, type UpdateModelInput, type UpdatePageInput, type UpdateWebhookInput, type UpdateWorkspaceInput, type UploadAssetInput, type UploadedAsset, type Webhook, type WebhookAdvancedConfig, type WebhookEvent, type WebhookListResponse, type WebhookWithSecret, type WriteContentInput, addModelFields, addPageFields, asStringArray, commandManagedLayout, contentApplied, createApiKey, createClient, createEntry, createForm, createManagedPage, createModel, createPage, createWorkspace, decodeStega, deleteForm, deleteMedia, deletePage, deleteSubmission, deleteWorkspace, encodeStega, entrySeoInput, formInitialValues, getApiKeyUsage, getEntry, getForm, getManagedLayout, getManagedPage, getMedia, getMember, getModel, getPage, getSubmission, getWorkspace, inviteMember, isMultiValueField, isRichText, listApiKeys, listEntries, listForms, listManagedPages, listMedia, listMembers, listModels, listPages, listSubmissions, listWorkspaces, onContentApplied, plain, portableText, publishManagedLayout, publishPage, publishedContentFile, publishedEntry, readPublishedContent, regenerateApiKey, removeMember, resetPublishedContentCache, resolveSeo, resolveStega, revokeApiKey, rich, search, setPageContent, shouldShowField, signIn, signInWithGithub, signInWithGoogle, signUp, stegaClean, stripStega, submitForm, toggleOption, updateApiKey, updateEntry, updateForm, updateMemberRole, updateModel, updatePage, updatePageModel, updateWorkspace, uploadMedia };
1931
+ /**
1932
+ * `inEditor()`: is this page running inside the BetterCMS Visual Editor's canvas?
1933
+ *
1934
+ * The editor frames the site and names the frame, so the answer is the page's own `window.name`:
1935
+ * there from the first script, kept through every navigation inside the frame, and never set on
1936
+ * a published page a visitor opens. A site asks before it starts what the canvas cannot share:
1937
+ *
1938
+ * const smooth = inEditor() ? null : new LocomotiveScroll({ el, smooth: true });
1939
+ *
1940
+ * The canvas owns the scroll, the pointer and the place on the page; the site's motion (scroll
1941
+ * triggers, timelines, WebGL scenes) runs there as it does live. What has to stand down is only
1942
+ * what takes those three away: scroll that is not the window's own, an intro that holds the
1943
+ * page, a cursor drawn over it.
1944
+ */
1945
+ /** The canvas frame's name. The dashboard sets this exact word (`EDITOR_FRAME_NAME`). */
1946
+ declare const EDITOR_FRAME_NAME = "bcms-editor";
1947
+ /** The least of `window` this needs. */
1948
+ interface FramedWindow {
1949
+ name: string;
1950
+ self: unknown;
1951
+ top: unknown;
1952
+ }
1953
+ /** True inside the editor's canvas. Safe where there is no window (a server render): false. */
1954
+ declare function inEditor(win?: FramedWindow | undefined): boolean;
1955
+
1956
+ export { type AddPageFieldsInput, type ApiKeyUsage, type ApiKeyWithRaw, type AuthResult, BetterCMSError as BCMSClientError, ErrorCodes as BCMSErrorCodes, BetterCMS, BetterCMSAdminClient, type BetterCMSAdminOptions, BetterCMSDeliveryClient, BetterCMSError, BetterCMSManagementClient, type BetterCMSManagementOptions, type BetterCMSReadClient, type BetterCMSSiteOptions, CONTENT_APPLIED, type CommandManagedLayoutInput, type ContentAppliedMessage, type CreateApiKeyInput, type CreateClientOptions, type CreateEntryInput, type CreateFormInput, type CreateManagedPageInput, type CreateModelInput, type CreatePageInput, type CreateWebhookInput, type CreateWorkspaceInput, type DeliveryForm, type DeliveryFormField, type DeliveryFormFieldType, EDITOR_FRAME_NAME, ErrorCodes, type ExtractionCandidate, type FormFieldInput, type FormListOptions, type FormSubmitError, type FormValue, type FormValues, type GetEntryOptions, type GetManagedLayoutOptions, type ListContentAllOptions, type ListContentOptions, type ListEntriesFilter, type ListEntriesOptions, type ListPagesOptions, type ManagedComponent, type ManagedComponentInput, type ManagedComponentSummary, type ManagedContentEntry, type ManagedContentModel, type ManagedForm, type ManagedFormInput, type ManagedLayoutClient, type ManagedLayoutDocument, type ManagedMediaAsset, type ManagedPage, type ManagementClient, type MediaListOptions, type MediaMetadata, type Member, type MemberRole, type ModelFieldset, PORTABLE_TEXT_FORMAT, type PageCreateReport, type PageListOptions, type PendingInvite, type PublishManagedLayoutInput, type PublishedContent, type ResolvedSeo, type RichTextValue, STEGA_OPEN, type SearchHit, type SearchOptions, type SeoInput, type SeoLocation, type SeoMeta, type SeoMetaInput, type SetPageContentInput, type StegaNode, type StegaPayload, type SubmissionListOptions, type SubmitFormOptions, type SubmitFormResult, type TextOrRich, type UpdateApiKeyInput, type UpdateAssetInput, type UpdateEntryInput, type UpdateFormInput, type UpdateModelInput, type UpdatePageInput, type UpdateWebhookInput, type UpdateWorkspaceInput, type UploadAssetInput, type UploadedAsset, type Webhook, type WebhookAdvancedConfig, type WebhookEvent, type WebhookListResponse, type WebhookWithSecret, type WriteContentInput, addModelFields, addPageFields, asStringArray, commandManagedLayout, contentApplied, createApiKey, createClient, createEntry, createForm, createManagedPage, createModel, createPage, createWorkspace, decodeStega, deleteForm, deleteMedia, deletePage, deleteSubmission, deleteWorkspace, encodeStega, entrySeoInput, formInitialValues, getApiKeyUsage, getEntry, getForm, getManagedLayout, getManagedPage, getMedia, getMember, getModel, getPage, getSubmission, getWorkspace, inEditor, inviteMember, isMultiValueField, isRichText, lines, listApiKeys, listEntries, listForms, listManagedPages, listMedia, listMembers, listModels, listPages, listSubmissions, listWorkspaces, onContentApplied, plain, portableText, publishManagedLayout, publishPage, publishedContentFile, publishedEntry, readPublishedContent, regenerateApiKey, removeMember, resetPublishedContentCache, resolveSeo, resolveStega, revokeApiKey, rich, search, setPageContent, shouldShowField, signIn, signInWithGithub, signInWithGoogle, signUp, stegaClean, stripStega, submitForm, toggleOption, updateApiKey, updateEntry, updateForm, updateMemberRole, updateModel, updatePage, updatePageModel, updateWorkspace, uploadMedia };
package/dist/index.d.ts CHANGED
@@ -768,6 +768,15 @@ interface ManagedComponent {
768
768
  thumbnail?: string | null;
769
769
  /** How an instance reads as a row in a parent's slot list. @see ComponentPreview */
770
770
  preview?: ComponentPreview | null;
771
+ /** The block icon (a /kit schema's document-level `icon`), a dock icon name. */
772
+ icon?: string | null;
773
+ /** The /kit tabs no top-level prop sits in (declared, empty). @see ComponentTab */
774
+ tabs?: Array<{
775
+ id: string;
776
+ label: string;
777
+ icon?: string;
778
+ order?: number;
779
+ }> | null;
771
780
  /** Send it back as `ifMatch` on updateComponent. */
772
781
  optimisticVersion?: number;
773
782
  }
@@ -789,6 +798,15 @@ interface ManagedComponentInput {
789
798
  description?: string;
790
799
  /** title/subtitle/media name top-level prop keys (422 `preview_key_unknown` otherwise); null clears it. */
791
800
  preview?: ComponentPreview | null;
801
+ /** The block icon, a dock icon name (bettercms://icons/dock); null clears it. */
802
+ icon?: string | null;
803
+ /** /kit tabs no top-level prop sits in; null clears them (422 component_tab_invalid on a prop's own tab). */
804
+ tabs?: Array<{
805
+ id: string;
806
+ label: string;
807
+ icon?: string;
808
+ order?: number;
809
+ }> | null;
792
810
  blockJson?: unknown[];
793
811
  props?: unknown[];
794
812
  /**
@@ -1429,6 +1447,16 @@ declare function plain(value: TextOrRich): string;
1429
1447
  * alone, so a body field still renders as a document.
1430
1448
  */
1431
1449
  declare function rich(value: TextOrRich, fallback?: string): string;
1450
+ /**
1451
+ * Renderable HTML for a ONE-LINE place: a heading, a button, a caption. `rich()`, except that several
1452
+ * paragraphs are that place's LINES, joined with `<br>` (a heading-styled first block counts as one).
1453
+ *
1454
+ * An author who presses Enter in a heading's editor stores a second paragraph. `rich()` leaves it a
1455
+ * paragraph, and `<h1><p>…</p><p>…</p></h1>` is what the build then draws, while a publish between
1456
+ * builds writes the same value into the built heading as lines. This draws what the publish draws.
1457
+ * A value holding anything else (a list, an image, a table) is returned as `rich()` returns it.
1458
+ */
1459
+ declare function lines(value: TextOrRich, fallback?: string): string;
1432
1460
 
1433
1461
  /**
1434
1462
  * resolveSeo — framework-agnostic page-over-site SEO merge for headless consumers.
@@ -1900,4 +1928,29 @@ interface WebhookListResponse {
1900
1928
  };
1901
1929
  }
1902
1930
 
1903
- export { type AddPageFieldsInput, type ApiKeyUsage, type ApiKeyWithRaw, type AuthResult, BetterCMSError as BCMSClientError, ErrorCodes as BCMSErrorCodes, BetterCMS, BetterCMSAdminClient, type BetterCMSAdminOptions, BetterCMSDeliveryClient, BetterCMSError, BetterCMSManagementClient, type BetterCMSManagementOptions, type BetterCMSReadClient, type BetterCMSSiteOptions, CONTENT_APPLIED, type CommandManagedLayoutInput, type ContentAppliedMessage, type CreateApiKeyInput, type CreateClientOptions, type CreateEntryInput, type CreateFormInput, type CreateManagedPageInput, type CreateModelInput, type CreatePageInput, type CreateWebhookInput, type CreateWorkspaceInput, type DeliveryForm, type DeliveryFormField, type DeliveryFormFieldType, ErrorCodes, type ExtractionCandidate, type FormFieldInput, type FormListOptions, type FormSubmitError, type FormValue, type FormValues, type GetEntryOptions, type GetManagedLayoutOptions, type ListContentAllOptions, type ListContentOptions, type ListEntriesFilter, type ListEntriesOptions, type ListPagesOptions, type ManagedComponent, type ManagedComponentInput, type ManagedComponentSummary, type ManagedContentEntry, type ManagedContentModel, type ManagedForm, type ManagedFormInput, type ManagedLayoutClient, type ManagedLayoutDocument, type ManagedMediaAsset, type ManagedPage, type ManagementClient, type MediaListOptions, type MediaMetadata, type Member, type MemberRole, type ModelFieldset, PORTABLE_TEXT_FORMAT, type PageCreateReport, type PageListOptions, type PendingInvite, type PublishManagedLayoutInput, type PublishedContent, type ResolvedSeo, type RichTextValue, STEGA_OPEN, type SearchHit, type SearchOptions, type SeoInput, type SeoLocation, type SeoMeta, type SeoMetaInput, type SetPageContentInput, type StegaNode, type StegaPayload, type SubmissionListOptions, type SubmitFormOptions, type SubmitFormResult, type TextOrRich, type UpdateApiKeyInput, type UpdateAssetInput, type UpdateEntryInput, type UpdateFormInput, type UpdateModelInput, type UpdatePageInput, type UpdateWebhookInput, type UpdateWorkspaceInput, type UploadAssetInput, type UploadedAsset, type Webhook, type WebhookAdvancedConfig, type WebhookEvent, type WebhookListResponse, type WebhookWithSecret, type WriteContentInput, addModelFields, addPageFields, asStringArray, commandManagedLayout, contentApplied, createApiKey, createClient, createEntry, createForm, createManagedPage, createModel, createPage, createWorkspace, decodeStega, deleteForm, deleteMedia, deletePage, deleteSubmission, deleteWorkspace, encodeStega, entrySeoInput, formInitialValues, getApiKeyUsage, getEntry, getForm, getManagedLayout, getManagedPage, getMedia, getMember, getModel, getPage, getSubmission, getWorkspace, inviteMember, isMultiValueField, isRichText, listApiKeys, listEntries, listForms, listManagedPages, listMedia, listMembers, listModels, listPages, listSubmissions, listWorkspaces, onContentApplied, plain, portableText, publishManagedLayout, publishPage, publishedContentFile, publishedEntry, readPublishedContent, regenerateApiKey, removeMember, resetPublishedContentCache, resolveSeo, resolveStega, revokeApiKey, rich, search, setPageContent, shouldShowField, signIn, signInWithGithub, signInWithGoogle, signUp, stegaClean, stripStega, submitForm, toggleOption, updateApiKey, updateEntry, updateForm, updateMemberRole, updateModel, updatePage, updatePageModel, updateWorkspace, uploadMedia };
1931
+ /**
1932
+ * `inEditor()`: is this page running inside the BetterCMS Visual Editor's canvas?
1933
+ *
1934
+ * The editor frames the site and names the frame, so the answer is the page's own `window.name`:
1935
+ * there from the first script, kept through every navigation inside the frame, and never set on
1936
+ * a published page a visitor opens. A site asks before it starts what the canvas cannot share:
1937
+ *
1938
+ * const smooth = inEditor() ? null : new LocomotiveScroll({ el, smooth: true });
1939
+ *
1940
+ * The canvas owns the scroll, the pointer and the place on the page; the site's motion (scroll
1941
+ * triggers, timelines, WebGL scenes) runs there as it does live. What has to stand down is only
1942
+ * what takes those three away: scroll that is not the window's own, an intro that holds the
1943
+ * page, a cursor drawn over it.
1944
+ */
1945
+ /** The canvas frame's name. The dashboard sets this exact word (`EDITOR_FRAME_NAME`). */
1946
+ declare const EDITOR_FRAME_NAME = "bcms-editor";
1947
+ /** The least of `window` this needs. */
1948
+ interface FramedWindow {
1949
+ name: string;
1950
+ self: unknown;
1951
+ top: unknown;
1952
+ }
1953
+ /** True inside the editor's canvas. Safe where there is no window (a server render): false. */
1954
+ declare function inEditor(win?: FramedWindow | undefined): boolean;
1955
+
1956
+ export { type AddPageFieldsInput, type ApiKeyUsage, type ApiKeyWithRaw, type AuthResult, BetterCMSError as BCMSClientError, ErrorCodes as BCMSErrorCodes, BetterCMS, BetterCMSAdminClient, type BetterCMSAdminOptions, BetterCMSDeliveryClient, BetterCMSError, BetterCMSManagementClient, type BetterCMSManagementOptions, type BetterCMSReadClient, type BetterCMSSiteOptions, CONTENT_APPLIED, type CommandManagedLayoutInput, type ContentAppliedMessage, type CreateApiKeyInput, type CreateClientOptions, type CreateEntryInput, type CreateFormInput, type CreateManagedPageInput, type CreateModelInput, type CreatePageInput, type CreateWebhookInput, type CreateWorkspaceInput, type DeliveryForm, type DeliveryFormField, type DeliveryFormFieldType, EDITOR_FRAME_NAME, ErrorCodes, type ExtractionCandidate, type FormFieldInput, type FormListOptions, type FormSubmitError, type FormValue, type FormValues, type GetEntryOptions, type GetManagedLayoutOptions, type ListContentAllOptions, type ListContentOptions, type ListEntriesFilter, type ListEntriesOptions, type ListPagesOptions, type ManagedComponent, type ManagedComponentInput, type ManagedComponentSummary, type ManagedContentEntry, type ManagedContentModel, type ManagedForm, type ManagedFormInput, type ManagedLayoutClient, type ManagedLayoutDocument, type ManagedMediaAsset, type ManagedPage, type ManagementClient, type MediaListOptions, type MediaMetadata, type Member, type MemberRole, type ModelFieldset, PORTABLE_TEXT_FORMAT, type PageCreateReport, type PageListOptions, type PendingInvite, type PublishManagedLayoutInput, type PublishedContent, type ResolvedSeo, type RichTextValue, STEGA_OPEN, type SearchHit, type SearchOptions, type SeoInput, type SeoLocation, type SeoMeta, type SeoMetaInput, type SetPageContentInput, type StegaNode, type StegaPayload, type SubmissionListOptions, type SubmitFormOptions, type SubmitFormResult, type TextOrRich, type UpdateApiKeyInput, type UpdateAssetInput, type UpdateEntryInput, type UpdateFormInput, type UpdateModelInput, type UpdatePageInput, type UpdateWebhookInput, type UpdateWorkspaceInput, type UploadAssetInput, type UploadedAsset, type Webhook, type WebhookAdvancedConfig, type WebhookEvent, type WebhookListResponse, type WebhookWithSecret, type WriteContentInput, addModelFields, addPageFields, asStringArray, commandManagedLayout, contentApplied, createApiKey, createClient, createEntry, createForm, createManagedPage, createModel, createPage, createWorkspace, decodeStega, deleteForm, deleteMedia, deletePage, deleteSubmission, deleteWorkspace, encodeStega, entrySeoInput, formInitialValues, getApiKeyUsage, getEntry, getForm, getManagedLayout, getManagedPage, getMedia, getMember, getModel, getPage, getSubmission, getWorkspace, inEditor, inviteMember, isMultiValueField, isRichText, lines, listApiKeys, listEntries, listForms, listManagedPages, listMedia, listMembers, listModels, listPages, listSubmissions, listWorkspaces, onContentApplied, plain, portableText, publishManagedLayout, publishPage, publishedContentFile, publishedEntry, readPublishedContent, regenerateApiKey, removeMember, resetPublishedContentCache, resolveSeo, resolveStega, revokeApiKey, rich, search, setPageContent, shouldShowField, signIn, signInWithGithub, signInWithGoogle, signUp, stegaClean, stripStega, submitForm, toggleOption, updateApiKey, updateEntry, updateForm, updateMemberRole, updateModel, updatePage, updatePageModel, updateWorkspace, uploadMedia };
package/dist/index.js CHANGED
@@ -1461,6 +1461,15 @@ function rich(value, fallback = "") {
1461
1461
  const html = (typeof value === "string" ? escapeHtml(value) : isRichText(value) ? value.html ?? "" : "").trim();
1462
1462
  return html ? unwrapLoneBlock(html) : escapeHtml(fallback);
1463
1463
  }
1464
+ function lines(value, fallback = "") {
1465
+ const html = rich(value, fallback);
1466
+ const block = /<(p|h[1-6])(?:\s[^>]*)?>([\s\S]*?)<\/\1>/gi;
1467
+ if (html.length > 1e4) return html;
1468
+ const found = [...html.matchAll(block)];
1469
+ if (found.length < 2 || html.replace(block, "").trim() !== "") return html;
1470
+ const shown = found.map((m) => m[2].trim()).filter((line) => line.replace(/<br\s*\/?>/gi, "").trim() !== "");
1471
+ return shown.length ? shown.join("<br>") : html;
1472
+ }
1464
1473
  function unwrapLoneBlock(html) {
1465
1474
  const m = html.match(/^<(p|div|h[1-6])(?:\s[^>]*)?>([\s\S]*)<\/\1>$/i);
1466
1475
  return m && !new RegExp(`</${m[1]}>`, "i").test(m[2]) ? m[2] : html;
@@ -1951,6 +1960,16 @@ async function submitForm(opts) {
1951
1960
 
1952
1961
  // src/index.ts
1953
1962
  import { isBlock, getBlockType } from "@bettercms-ai/types";
1963
+
1964
+ // src/in-editor.ts
1965
+ var EDITOR_FRAME_NAME = "bcms-editor";
1966
+ function inEditor(win = globalThis.window) {
1967
+ try {
1968
+ return !!win && win.name === EDITOR_FRAME_NAME && win.self !== win.top;
1969
+ } catch {
1970
+ return false;
1971
+ }
1972
+ }
1954
1973
  export {
1955
1974
  BetterCMSError as BCMSClientError,
1956
1975
  ErrorCodes as BCMSErrorCodes,
@@ -1960,6 +1979,7 @@ export {
1960
1979
  BetterCMSError,
1961
1980
  BetterCMSManagementClient,
1962
1981
  CONTENT_APPLIED,
1982
+ EDITOR_FRAME_NAME,
1963
1983
  ErrorCodes,
1964
1984
  PORTABLE_TEXT_FORMAT,
1965
1985
  STEGA_OPEN,
@@ -2001,10 +2021,12 @@ export {
2001
2021
  default2 as imageUrlBuilder,
2002
2022
  imageValueObjectPosition,
2003
2023
  imageValueUrl,
2024
+ inEditor,
2004
2025
  inviteMember,
2005
2026
  isBlock,
2006
2027
  isMultiValueField,
2007
2028
  isRichText,
2029
+ lines,
2008
2030
  listApiKeys,
2009
2031
  listEntries,
2010
2032
  listForms2 as listForms,