@select-org/select-post-builder 1.1.8 → 1.1.10

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.
@@ -5221,7 +5221,7 @@ function focusFirst$2(candidates, preventScroll = false) {
5221
5221
  function wrapArray$2(array, startIndex) {
5222
5222
  return array.map((_, index2) => array[(startIndex + index2) % array.length]);
5223
5223
  }
5224
- var Root$8 = RovingFocusGroup;
5224
+ var Root$9 = RovingFocusGroup;
5225
5225
  var Item$1 = RovingFocusGroupItem;
5226
5226
  function useStateMachine(initialState, machine) {
5227
5227
  return React__namespace.useReducer((state2, event) => {
@@ -5401,7 +5401,7 @@ var TabsList$1 = React__namespace.forwardRef(
5401
5401
  const context = useTabsContext(TAB_LIST_NAME, __scopeTabs);
5402
5402
  const rovingFocusGroupScope = useRovingFocusGroupScope$1(__scopeTabs);
5403
5403
  return /* @__PURE__ */ jsxRuntime.jsx(
5404
- Root$8,
5404
+ Root$9,
5405
5405
  {
5406
5406
  asChild: true,
5407
5407
  ...rovingFocusGroupScope,
@@ -13062,7 +13062,7 @@ const arrow$2 = (options, deps) => ({
13062
13062
  ...arrow$1$1(options),
13063
13063
  options: [options, deps]
13064
13064
  });
13065
- var NAME$3 = "Arrow";
13065
+ var NAME$4 = "Arrow";
13066
13066
  var Arrow$1 = React__namespace.forwardRef((props, forwardedRef) => {
13067
13067
  const { children, width = 10, height = 5, ...arrowProps } = props;
13068
13068
  return /* @__PURE__ */ jsxRuntime.jsx(
@@ -13078,8 +13078,8 @@ var Arrow$1 = React__namespace.forwardRef((props, forwardedRef) => {
13078
13078
  }
13079
13079
  );
13080
13080
  });
13081
- Arrow$1.displayName = NAME$3;
13082
- var Root$7 = Arrow$1;
13081
+ Arrow$1.displayName = NAME$4;
13082
+ var Root$8 = Arrow$1;
13083
13083
  function useSize(element) {
13084
13084
  const [size2, setSize] = React__namespace.useState(void 0);
13085
13085
  useLayoutEffect2(() => {
@@ -13325,7 +13325,7 @@ var PopperArrow = React__namespace.forwardRef(function PopperArrow2(props, forwa
13325
13325
  visibility: contentContext.shouldHideArrow ? "hidden" : void 0
13326
13326
  },
13327
13327
  children: /* @__PURE__ */ jsxRuntime.jsx(
13328
- Root$7,
13328
+ Root$8,
13329
13329
  {
13330
13330
  ...arrowProps,
13331
13331
  ref: forwardedRef,
@@ -13415,7 +13415,7 @@ var VISUALLY_HIDDEN_STYLES = Object.freeze({
13415
13415
  whiteSpace: "nowrap",
13416
13416
  wordWrap: "normal"
13417
13417
  });
13418
- var NAME$2 = "VisuallyHidden";
13418
+ var NAME$3 = "VisuallyHidden";
13419
13419
  var VisuallyHidden = React__namespace.forwardRef(
13420
13420
  (props, forwardedRef) => {
13421
13421
  return /* @__PURE__ */ jsxRuntime.jsx(
@@ -13428,8 +13428,8 @@ var VisuallyHidden = React__namespace.forwardRef(
13428
13428
  );
13429
13429
  }
13430
13430
  );
13431
- VisuallyHidden.displayName = NAME$2;
13432
- var Root$6 = VisuallyHidden;
13431
+ VisuallyHidden.displayName = NAME$3;
13432
+ var Root$7 = VisuallyHidden;
13433
13433
  var getDefaultParent = function(originalTarget) {
13434
13434
  if (typeof document === "undefined") {
13435
13435
  return null;
@@ -16316,12 +16316,12 @@ function useImageLoadingStatus(src, { referrerPolicy, crossOrigin }) {
16316
16316
  }, [image, crossOrigin, referrerPolicy]);
16317
16317
  return loadingStatus;
16318
16318
  }
16319
- var Root$5 = Avatar$1;
16319
+ var Root$6 = Avatar$1;
16320
16320
  var Image = AvatarImage$1;
16321
16321
  var Fallback = AvatarFallback$1;
16322
16322
  function Avatar({ className, ...props }) {
16323
16323
  return /* @__PURE__ */ jsxRuntime.jsx(
16324
- Root$5,
16324
+ Root$6,
16325
16325
  {
16326
16326
  "data-slot": "avatar",
16327
16327
  className: cn("relative flex size-8 shrink-0 overflow-hidden rounded-full", className),
@@ -16845,7 +16845,7 @@ var TooltipContentImpl = React__namespace.forwardRef(
16845
16845
  },
16846
16846
  children: [
16847
16847
  /* @__PURE__ */ jsxRuntime.jsx(Slottable, { children }),
16848
- /* @__PURE__ */ jsxRuntime.jsx(VisuallyHiddenContentContextProvider, { scope: __scopeTooltip, isInside: true, children: /* @__PURE__ */ jsxRuntime.jsx(Root$6, { id: context.contentId, role: "tooltip", children: ariaLabel || children }) })
16848
+ /* @__PURE__ */ jsxRuntime.jsx(VisuallyHiddenContentContextProvider, { scope: __scopeTooltip, isInside: true, children: /* @__PURE__ */ jsxRuntime.jsx(Root$7, { id: context.contentId, role: "tooltip", children: ariaLabel || children }) })
16849
16849
  ]
16850
16850
  }
16851
16851
  )
@@ -17345,7 +17345,7 @@ var DescriptionWarning = ({ contentRef, descriptionId }) => {
17345
17345
  }, [MESSAGE, contentRef, descriptionId]);
17346
17346
  return null;
17347
17347
  };
17348
- var Root$4 = Dialog$1;
17348
+ var Root$5 = Dialog$1;
17349
17349
  var Trigger$2 = DialogTrigger$1;
17350
17350
  var Portal$2 = DialogPortal$1;
17351
17351
  var Overlay = DialogOverlay$1;
@@ -17354,7 +17354,7 @@ var Title = DialogTitle$1;
17354
17354
  var Description = DialogDescription;
17355
17355
  var Close = DialogClose$1;
17356
17356
  function Dialog({ ...props }) {
17357
- return /* @__PURE__ */ jsxRuntime.jsx(Root$4, { "data-slot": "dialog", ...props });
17357
+ return /* @__PURE__ */ jsxRuntime.jsx(Root$5, { "data-slot": "dialog", ...props });
17358
17358
  }
17359
17359
  const DialogTrigger = React.forwardRef((props, ref) => /* @__PURE__ */ jsxRuntime.jsx(Trigger$2, { ref, "data-slot": "dialog-trigger", ...props }));
17360
17360
  function DialogPortal({ ...props }) {
@@ -17443,7 +17443,7 @@ React.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.js
17443
17443
  ...props
17444
17444
  }
17445
17445
  ));
17446
- var NAME$1 = "Label";
17446
+ var NAME$2 = "Label";
17447
17447
  var Label$2 = React__namespace.forwardRef((props, forwardedRef) => {
17448
17448
  return /* @__PURE__ */ jsxRuntime.jsx(
17449
17449
  Primitive.label,
@@ -17459,11 +17459,11 @@ var Label$2 = React__namespace.forwardRef((props, forwardedRef) => {
17459
17459
  }
17460
17460
  );
17461
17461
  });
17462
- Label$2.displayName = NAME$1;
17463
- var Root$3 = Label$2;
17462
+ Label$2.displayName = NAME$2;
17463
+ var Root$4 = Label$2;
17464
17464
  function Label$1({ className, ...props }) {
17465
17465
  return /* @__PURE__ */ jsxRuntime.jsx(
17466
- Root$3,
17466
+ Root$4,
17467
17467
  {
17468
17468
  "data-slot": "label",
17469
17469
  className: cn(
@@ -17474,6 +17474,49 @@ function Label$1({ className, ...props }) {
17474
17474
  }
17475
17475
  );
17476
17476
  }
17477
+ var NAME$1 = "Separator";
17478
+ var DEFAULT_ORIENTATION = "horizontal";
17479
+ var ORIENTATIONS = ["horizontal", "vertical"];
17480
+ var Separator$2 = React__namespace.forwardRef((props, forwardedRef) => {
17481
+ const { decorative, orientation: orientationProp = DEFAULT_ORIENTATION, ...domProps } = props;
17482
+ const orientation = isValidOrientation(orientationProp) ? orientationProp : DEFAULT_ORIENTATION;
17483
+ const ariaOrientation = orientation === "vertical" ? orientation : void 0;
17484
+ const semanticProps = decorative ? { role: "none" } : { "aria-orientation": ariaOrientation, role: "separator" };
17485
+ return /* @__PURE__ */ jsxRuntime.jsx(
17486
+ Primitive.div,
17487
+ {
17488
+ "data-orientation": orientation,
17489
+ ...semanticProps,
17490
+ ...domProps,
17491
+ ref: forwardedRef
17492
+ }
17493
+ );
17494
+ });
17495
+ Separator$2.displayName = NAME$1;
17496
+ function isValidOrientation(orientation) {
17497
+ return ORIENTATIONS.includes(orientation);
17498
+ }
17499
+ var Root$3 = Separator$2;
17500
+ function Separator$1({
17501
+ className,
17502
+ orientation = "horizontal",
17503
+ decorative = true,
17504
+ ...props
17505
+ }) {
17506
+ return /* @__PURE__ */ jsxRuntime.jsx(
17507
+ Root$3,
17508
+ {
17509
+ "data-slot": "separator",
17510
+ decorative,
17511
+ orientation,
17512
+ className: cn(
17513
+ "bg-border shrink-0 data-[orientation=horizontal]:h-px data-[orientation=horizontal]:w-full data-[orientation=vertical]:h-full data-[orientation=vertical]:w-px",
17514
+ className
17515
+ ),
17516
+ ...props
17517
+ }
17518
+ );
17519
+ }
17477
17520
  function FieldSet({ className, ...props }) {
17478
17521
  return /* @__PURE__ */ jsxRuntime.jsx(
17479
17522
  "fieldset",
@@ -19436,7 +19479,7 @@ var MenuContentImpl = React__namespace.forwardRef(
19436
19479
  onInteractOutside,
19437
19480
  onDismiss,
19438
19481
  children: /* @__PURE__ */ jsxRuntime.jsx(
19439
- Root$8,
19482
+ Root$9,
19440
19483
  {
19441
19484
  asChild: true,
19442
19485
  ...rovingFocusGroupScope,
@@ -29395,18 +29438,18 @@ const Mention = core.Node.create({
29395
29438
  return {
29396
29439
  id: {
29397
29440
  default: null,
29398
- parseHTML: (element) => element.getAttribute("data-id"),
29441
+ parseHTML: (element) => element.getAttribute("data-mention-id"),
29399
29442
  renderHTML: (attributes) => {
29400
29443
  if (!attributes.id) return {};
29401
- return { "data-id": attributes.id };
29444
+ return { "data-mention-id": attributes.id };
29402
29445
  }
29403
29446
  },
29404
29447
  label: {
29405
29448
  default: null,
29406
- parseHTML: (element) => element.getAttribute("data-label"),
29449
+ parseHTML: (element) => element.getAttribute("data-mention-label"),
29407
29450
  renderHTML: (attributes) => {
29408
29451
  if (!attributes.label) return {};
29409
- return { "data-label": attributes.label };
29452
+ return { "data-mention-label": attributes.label };
29410
29453
  }
29411
29454
  },
29412
29455
  mentionSuggestionChar: {
@@ -29416,14 +29459,70 @@ const Mention = core.Node.create({
29416
29459
  return { "data-mention-suggestion-char": attributes.mentionSuggestionChar };
29417
29460
  }
29418
29461
  },
29419
- avatar: { default: null, parseHTML: () => null, renderHTML: () => ({}) },
29420
- inThisThread: { default: 1, parseHTML: () => null, renderHTML: () => ({}) },
29421
- name: { default: null, parseHTML: () => null, renderHTML: () => ({}) },
29422
- selectId: { default: null, parseHTML: () => null, renderHTML: () => ({}) },
29423
- type: { default: null, parseHTML: () => null, renderHTML: () => ({}) },
29424
- from: { default: PostType.Post, parseHTML: () => null, renderHTML: () => ({}) },
29425
- isCrossExposureEnable: { default: null, parseHTML: () => null, renderHTML: () => ({}) },
29426
- matchStartPosition: { default: -1, parseHTML: () => null, renderHTML: () => ({}) }
29462
+ avatar: {
29463
+ default: null,
29464
+ parseHTML: (element) => element.getAttribute("data-mention-avatar"),
29465
+ renderHTML: (attributes) => {
29466
+ if (!attributes.avatar) return {};
29467
+ return { "data-mention-avatar": attributes.avatar };
29468
+ }
29469
+ },
29470
+ inThisThread: {
29471
+ default: 1,
29472
+ parseHTML: (element) => element.getAttribute("data-mention-in-this-thread"),
29473
+ renderHTML: (attributes) => {
29474
+ if (!attributes.inThisThread) return {};
29475
+ return { "data-mention-in-this-thread": attributes.inThisThread };
29476
+ }
29477
+ },
29478
+ name: {
29479
+ default: null,
29480
+ parseHTML: (element) => element.getAttribute("data-mention-name"),
29481
+ renderHTML: (attributes) => {
29482
+ if (!attributes.name) return {};
29483
+ return { "data-mention-name": attributes.name };
29484
+ }
29485
+ },
29486
+ selectId: {
29487
+ default: null,
29488
+ parseHTML: (element) => element.getAttribute("data-mention-select-id"),
29489
+ renderHTML: (attributes) => {
29490
+ if (!attributes.selectId) return {};
29491
+ return { "data-mention-select-id": attributes.selectId };
29492
+ }
29493
+ },
29494
+ type: {
29495
+ default: null,
29496
+ parseHTML: (element) => element.getAttribute("data-mention-type"),
29497
+ renderHTML: (attributes) => {
29498
+ if (!attributes.type) return {};
29499
+ return { "data-mention-type": attributes.type };
29500
+ }
29501
+ },
29502
+ from: {
29503
+ default: PostType.Post,
29504
+ parseHTML: (element) => element.getAttribute("data-mention-from"),
29505
+ renderHTML: (attributes) => {
29506
+ if (!attributes.from) return {};
29507
+ return { "data-mention-from": attributes.from };
29508
+ }
29509
+ },
29510
+ isCrossExposureEnable: {
29511
+ default: null,
29512
+ parseHTML: (element) => element.getAttribute("data-mention-is-cross-exposure-enable"),
29513
+ renderHTML: (attributes) => {
29514
+ if (!attributes.isCrossExposureEnable) return {};
29515
+ return { "data-mention-is-cross-exposure-enable": attributes.isCrossExposureEnable };
29516
+ }
29517
+ },
29518
+ matchStartPosition: {
29519
+ default: -1,
29520
+ parseHTML: (element) => element.getAttribute("data-mention-match-start-position"),
29521
+ renderHTML: (attributes) => {
29522
+ if (!attributes.matchStartPosition) return {};
29523
+ return { "data-mention-match-start-position": attributes.matchStartPosition };
29524
+ }
29525
+ }
29427
29526
  };
29428
29527
  },
29429
29528
  parseHTML() {
@@ -30530,8 +30629,16 @@ const configureMentionExtension = (api, mfs, store) => {
30530
30629
  },
30531
30630
  renderHTML({ node, suggestion: suggestion2, isFocused }) {
30532
30631
  const char = suggestion2?.char ?? "@";
30632
+ const avatar = node?.attrs?.avatar;
30633
+ const type = node?.attrs?.type;
30634
+ const from = node?.attrs?.from;
30635
+ const inThisThread = node?.attrs?.inThisThread;
30636
+ const isCrossExposureEnable = node?.attrs?.isCrossExposureEnable;
30637
+ const matchStartPosition = node?.attrs?.matchStartPosition;
30638
+ const selectId = node?.attrs?.selectId;
30533
30639
  const label = node.attrs.label ?? node.attrs.id;
30534
30640
  const id = node.attrs.id;
30641
+ const name = node?.attrs?.name;
30535
30642
  const isRNWebView = isReactNativeWebView();
30536
30643
  const mentionClasses = char === "@" ? "inline-block rounded italic font-medium cursor-pointer transition-all duration-200 text-blue-700 dark:text-blue-300" : "inline-block rounded italic font-medium cursor-pointer transition-all duration-200 text-blue-700 dark:text-blue-300";
30537
30644
  const baseAttributes = {
@@ -30539,6 +30646,17 @@ const configureMentionExtension = (api, mfs, store) => {
30539
30646
  "data-id": id,
30540
30647
  "data-label": label,
30541
30648
  "data-mention-suggestion-char": char,
30649
+ // Newly added attributes
30650
+ "data-mention-id": id,
30651
+ "data-mention-label": label,
30652
+ "data-mention-avatar": avatar,
30653
+ "data-mention-in-this-thread": inThisThread,
30654
+ "data-mention-name": name,
30655
+ "data-mention-select-id": selectId,
30656
+ "data-mention-type": type,
30657
+ "data-mention-from": from,
30658
+ "data-mention-is-cross-exposure-enable": isCrossExposureEnable,
30659
+ "data-mention-match-start-position": matchStartPosition,
30542
30660
  class: mentionClasses
30543
30661
  };
30544
30662
  if (isRNWebView) {
@@ -31841,9 +31959,7 @@ const PostBuilderEditor = ({
31841
31959
  });
31842
31960
  return () => cancelAnimationFrame(frame);
31843
31961
  }, [editor, sessionId, editorTab]);
31844
- if (!isMounted || !editor) {
31845
- return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "max-w-full w-full", "data-theme": "select-post-builder", children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex items-center justify-center p-8", children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: "animate-pulse", children: "Loading editor..." }) }) });
31846
- }
31962
+ if (!isMounted || !editor) return /* @__PURE__ */ jsxRuntime.jsx(EditorSkeleton, {});
31847
31963
  return /* @__PURE__ */ jsxRuntime.jsx(AnalyticsSessionProvider, { sessionId, editorType: editorTab, placement, children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "max-w-full w-full", "data-theme": "select-post-builder", children: [
31848
31964
  /* @__PURE__ */ jsxRuntime.jsx(react.EditorContext.Provider, { value: providerValue, children: openModal ? /* @__PURE__ */ jsxRuntime.jsx(
31849
31965
  PostBuilderEditorInstanceWithDialog,
@@ -31880,6 +31996,16 @@ const PostBuilderEditor = ({
31880
31996
  /* @__PURE__ */ jsxRuntime.jsx(Toaster2, { position: "top-center" })
31881
31997
  ] }) });
31882
31998
  };
31999
+ const EditorSkeleton = () => /* @__PURE__ */ jsxRuntime.jsx("div", { className: "max-w-full w-full", "data-theme": "select-post-builder", children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "space-y-3", children: [
32000
+ /* @__PURE__ */ jsxRuntime.jsx(Skeleton, { className: "h-8 w-40" }),
32001
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "min-h-60 w-full flex flex-col overflow-hidden rounded-lg border", children: [
32002
+ /* @__PURE__ */ jsxRuntime.jsx(Skeleton, { className: "h-10 rounded-b-none" }),
32003
+ /* @__PURE__ */ jsxRuntime.jsx(Separator$1, {}),
32004
+ /* @__PURE__ */ jsxRuntime.jsx(Skeleton, { className: "h-44 rounded-none" }),
32005
+ /* @__PURE__ */ jsxRuntime.jsx(Separator$1, {}),
32006
+ /* @__PURE__ */ jsxRuntime.jsx(Skeleton, { className: "h-[47px] rounded-t-none flex items-center justify-end p-2", children: /* @__PURE__ */ jsxRuntime.jsx(Skeleton, { className: "h-full w-20 bg-accent-foreground/20" }) })
32007
+ ] })
32008
+ ] }) });
31883
32009
  const translationFallback = {
31884
32010
  // General
31885
32011
  addKey: "Add",
@@ -1576,6 +1576,10 @@ body {
1576
1576
  height: calc(var(--spacing) * 38);
1577
1577
  }
1578
1578
 
1579
+ [data-theme="select-post-builder"] .h-44 {
1580
+ height: calc(var(--spacing) * 44);
1581
+ }
1582
+
1579
1583
  [data-theme="select-post-builder"] .h-80 {
1580
1584
  height: calc(var(--spacing) * 80);
1581
1585
  }
@@ -1588,6 +1592,10 @@ body {
1588
1592
  height: 1.15rem;
1589
1593
  }
1590
1594
 
1595
+ [data-theme="select-post-builder"] .h-\[47px\] {
1596
+ height: 47px;
1597
+ }
1598
+
1591
1599
  [data-theme="select-post-builder"] .h-\[80vh\] {
1592
1600
  height: 80vh;
1593
1601
  }
@@ -1688,10 +1696,18 @@ body {
1688
1696
  width: calc(var(--spacing) * 16);
1689
1697
  }
1690
1698
 
1699
+ [data-theme="select-post-builder"] .w-20 {
1700
+ width: calc(var(--spacing) * 20);
1701
+ }
1702
+
1691
1703
  [data-theme="select-post-builder"] .w-32 {
1692
1704
  width: calc(var(--spacing) * 32);
1693
1705
  }
1694
1706
 
1707
+ [data-theme="select-post-builder"] .w-40 {
1708
+ width: calc(var(--spacing) * 40);
1709
+ }
1710
+
1695
1711
  [data-theme="select-post-builder"] .w-44 {
1696
1712
  width: calc(var(--spacing) * 44);
1697
1713
  }
@@ -2066,6 +2082,16 @@ body {
2066
2082
  border-radius: var(--radius-xs);
2067
2083
  }
2068
2084
 
2085
+ [data-theme="select-post-builder"] .rounded-t-none {
2086
+ border-top-left-radius: 0;
2087
+ border-top-right-radius: 0;
2088
+ }
2089
+
2090
+ [data-theme="select-post-builder"] .rounded-b-none {
2091
+ border-bottom-right-radius: 0;
2092
+ border-bottom-left-radius: 0;
2093
+ }
2094
+
2069
2095
  [data-theme="select-post-builder"] .border {
2070
2096
  border-style: var(--tw-border-style);
2071
2097
  border-width: 1px;
@@ -2156,7 +2182,21 @@ body {
2156
2182
  border-color: #0000;
2157
2183
  }
2158
2184
 
2159
- [data-theme="select-post-builder"] .bg-accent, [data-theme="select-post-builder"] .bg-accent\/10 {
2185
+ [data-theme="select-post-builder"] .bg-accent {
2186
+ background-color: var(--accent);
2187
+ }
2188
+
2189
+ [data-theme="select-post-builder"] .bg-accent-foreground\/20 {
2190
+ background-color: var(--accent-foreground);
2191
+ }
2192
+
2193
+ @supports (color: color-mix(in lab, red, red)) {
2194
+ [data-theme="select-post-builder"] .bg-accent-foreground\/20 {
2195
+ background-color: color-mix(in oklab, var(--accent-foreground) 20%, transparent);
2196
+ }
2197
+ }
2198
+
2199
+ [data-theme="select-post-builder"] .bg-accent\/10 {
2160
2200
  background-color: var(--accent);
2161
2201
  }
2162
2202
 
@@ -2422,10 +2462,6 @@ body {
2422
2462
  padding: calc(var(--spacing) * 6);
2423
2463
  }
2424
2464
 
2425
- [data-theme="select-post-builder"] .p-8 {
2426
- padding: calc(var(--spacing) * 8);
2427
- }
2428
-
2429
2465
  [data-theme="select-post-builder"] .p-\[3px\] {
2430
2466
  padding: 3px;
2431
2467
  }
@@ -5191,7 +5191,7 @@ function focusFirst$2(candidates, preventScroll = false) {
5191
5191
  function wrapArray$2(array, startIndex) {
5192
5192
  return array.map((_, index2) => array[(startIndex + index2) % array.length]);
5193
5193
  }
5194
- var Root$8 = RovingFocusGroup;
5194
+ var Root$9 = RovingFocusGroup;
5195
5195
  var Item$1 = RovingFocusGroupItem;
5196
5196
  function useStateMachine(initialState, machine) {
5197
5197
  return React.useReducer((state, event) => {
@@ -5371,7 +5371,7 @@ var TabsList$1 = React.forwardRef(
5371
5371
  const context = useTabsContext(TAB_LIST_NAME, __scopeTabs);
5372
5372
  const rovingFocusGroupScope = useRovingFocusGroupScope$1(__scopeTabs);
5373
5373
  return /* @__PURE__ */ jsx(
5374
- Root$8,
5374
+ Root$9,
5375
5375
  {
5376
5376
  asChild: true,
5377
5377
  ...rovingFocusGroupScope,
@@ -13032,7 +13032,7 @@ const arrow$2 = (options, deps) => ({
13032
13032
  ...arrow$1$1(options),
13033
13033
  options: [options, deps]
13034
13034
  });
13035
- var NAME$3 = "Arrow";
13035
+ var NAME$4 = "Arrow";
13036
13036
  var Arrow$1 = React.forwardRef((props, forwardedRef) => {
13037
13037
  const { children, width = 10, height = 5, ...arrowProps } = props;
13038
13038
  return /* @__PURE__ */ jsx(
@@ -13048,8 +13048,8 @@ var Arrow$1 = React.forwardRef((props, forwardedRef) => {
13048
13048
  }
13049
13049
  );
13050
13050
  });
13051
- Arrow$1.displayName = NAME$3;
13052
- var Root$7 = Arrow$1;
13051
+ Arrow$1.displayName = NAME$4;
13052
+ var Root$8 = Arrow$1;
13053
13053
  function useSize(element) {
13054
13054
  const [size2, setSize] = React.useState(void 0);
13055
13055
  useLayoutEffect2(() => {
@@ -13295,7 +13295,7 @@ var PopperArrow = React.forwardRef(function PopperArrow2(props, forwardedRef) {
13295
13295
  visibility: contentContext.shouldHideArrow ? "hidden" : void 0
13296
13296
  },
13297
13297
  children: /* @__PURE__ */ jsx(
13298
- Root$7,
13298
+ Root$8,
13299
13299
  {
13300
13300
  ...arrowProps,
13301
13301
  ref: forwardedRef,
@@ -13385,7 +13385,7 @@ var VISUALLY_HIDDEN_STYLES = Object.freeze({
13385
13385
  whiteSpace: "nowrap",
13386
13386
  wordWrap: "normal"
13387
13387
  });
13388
- var NAME$2 = "VisuallyHidden";
13388
+ var NAME$3 = "VisuallyHidden";
13389
13389
  var VisuallyHidden = React.forwardRef(
13390
13390
  (props, forwardedRef) => {
13391
13391
  return /* @__PURE__ */ jsx(
@@ -13398,8 +13398,8 @@ var VisuallyHidden = React.forwardRef(
13398
13398
  );
13399
13399
  }
13400
13400
  );
13401
- VisuallyHidden.displayName = NAME$2;
13402
- var Root$6 = VisuallyHidden;
13401
+ VisuallyHidden.displayName = NAME$3;
13402
+ var Root$7 = VisuallyHidden;
13403
13403
  var getDefaultParent = function(originalTarget) {
13404
13404
  if (typeof document === "undefined") {
13405
13405
  return null;
@@ -16286,12 +16286,12 @@ function useImageLoadingStatus(src, { referrerPolicy, crossOrigin }) {
16286
16286
  }, [image, crossOrigin, referrerPolicy]);
16287
16287
  return loadingStatus;
16288
16288
  }
16289
- var Root$5 = Avatar$1;
16289
+ var Root$6 = Avatar$1;
16290
16290
  var Image = AvatarImage$1;
16291
16291
  var Fallback = AvatarFallback$1;
16292
16292
  function Avatar({ className, ...props }) {
16293
16293
  return /* @__PURE__ */ jsx(
16294
- Root$5,
16294
+ Root$6,
16295
16295
  {
16296
16296
  "data-slot": "avatar",
16297
16297
  className: cn("relative flex size-8 shrink-0 overflow-hidden rounded-full", className),
@@ -16815,7 +16815,7 @@ var TooltipContentImpl = React.forwardRef(
16815
16815
  },
16816
16816
  children: [
16817
16817
  /* @__PURE__ */ jsx(Slottable, { children }),
16818
- /* @__PURE__ */ jsx(VisuallyHiddenContentContextProvider, { scope: __scopeTooltip, isInside: true, children: /* @__PURE__ */ jsx(Root$6, { id: context.contentId, role: "tooltip", children: ariaLabel || children }) })
16818
+ /* @__PURE__ */ jsx(VisuallyHiddenContentContextProvider, { scope: __scopeTooltip, isInside: true, children: /* @__PURE__ */ jsx(Root$7, { id: context.contentId, role: "tooltip", children: ariaLabel || children }) })
16819
16819
  ]
16820
16820
  }
16821
16821
  )
@@ -17315,7 +17315,7 @@ var DescriptionWarning = ({ contentRef, descriptionId }) => {
17315
17315
  }, [MESSAGE, contentRef, descriptionId]);
17316
17316
  return null;
17317
17317
  };
17318
- var Root$4 = Dialog$1;
17318
+ var Root$5 = Dialog$1;
17319
17319
  var Trigger$2 = DialogTrigger$1;
17320
17320
  var Portal$2 = DialogPortal$1;
17321
17321
  var Overlay = DialogOverlay$1;
@@ -17324,7 +17324,7 @@ var Title = DialogTitle$1;
17324
17324
  var Description = DialogDescription;
17325
17325
  var Close = DialogClose$1;
17326
17326
  function Dialog({ ...props }) {
17327
- return /* @__PURE__ */ jsx(Root$4, { "data-slot": "dialog", ...props });
17327
+ return /* @__PURE__ */ jsx(Root$5, { "data-slot": "dialog", ...props });
17328
17328
  }
17329
17329
  const DialogTrigger = forwardRef((props, ref) => /* @__PURE__ */ jsx(Trigger$2, { ref, "data-slot": "dialog-trigger", ...props }));
17330
17330
  function DialogPortal({ ...props }) {
@@ -17413,7 +17413,7 @@ forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
17413
17413
  ...props
17414
17414
  }
17415
17415
  ));
17416
- var NAME$1 = "Label";
17416
+ var NAME$2 = "Label";
17417
17417
  var Label$2 = React.forwardRef((props, forwardedRef) => {
17418
17418
  return /* @__PURE__ */ jsx(
17419
17419
  Primitive.label,
@@ -17429,11 +17429,11 @@ var Label$2 = React.forwardRef((props, forwardedRef) => {
17429
17429
  }
17430
17430
  );
17431
17431
  });
17432
- Label$2.displayName = NAME$1;
17433
- var Root$3 = Label$2;
17432
+ Label$2.displayName = NAME$2;
17433
+ var Root$4 = Label$2;
17434
17434
  function Label$1({ className, ...props }) {
17435
17435
  return /* @__PURE__ */ jsx(
17436
- Root$3,
17436
+ Root$4,
17437
17437
  {
17438
17438
  "data-slot": "label",
17439
17439
  className: cn(
@@ -17444,6 +17444,49 @@ function Label$1({ className, ...props }) {
17444
17444
  }
17445
17445
  );
17446
17446
  }
17447
+ var NAME$1 = "Separator";
17448
+ var DEFAULT_ORIENTATION = "horizontal";
17449
+ var ORIENTATIONS = ["horizontal", "vertical"];
17450
+ var Separator$2 = React.forwardRef((props, forwardedRef) => {
17451
+ const { decorative, orientation: orientationProp = DEFAULT_ORIENTATION, ...domProps } = props;
17452
+ const orientation = isValidOrientation(orientationProp) ? orientationProp : DEFAULT_ORIENTATION;
17453
+ const ariaOrientation = orientation === "vertical" ? orientation : void 0;
17454
+ const semanticProps = decorative ? { role: "none" } : { "aria-orientation": ariaOrientation, role: "separator" };
17455
+ return /* @__PURE__ */ jsx(
17456
+ Primitive.div,
17457
+ {
17458
+ "data-orientation": orientation,
17459
+ ...semanticProps,
17460
+ ...domProps,
17461
+ ref: forwardedRef
17462
+ }
17463
+ );
17464
+ });
17465
+ Separator$2.displayName = NAME$1;
17466
+ function isValidOrientation(orientation) {
17467
+ return ORIENTATIONS.includes(orientation);
17468
+ }
17469
+ var Root$3 = Separator$2;
17470
+ function Separator$1({
17471
+ className,
17472
+ orientation = "horizontal",
17473
+ decorative = true,
17474
+ ...props
17475
+ }) {
17476
+ return /* @__PURE__ */ jsx(
17477
+ Root$3,
17478
+ {
17479
+ "data-slot": "separator",
17480
+ decorative,
17481
+ orientation,
17482
+ className: cn(
17483
+ "bg-border shrink-0 data-[orientation=horizontal]:h-px data-[orientation=horizontal]:w-full data-[orientation=vertical]:h-full data-[orientation=vertical]:w-px",
17484
+ className
17485
+ ),
17486
+ ...props
17487
+ }
17488
+ );
17489
+ }
17447
17490
  function FieldSet({ className, ...props }) {
17448
17491
  return /* @__PURE__ */ jsx(
17449
17492
  "fieldset",
@@ -19406,7 +19449,7 @@ var MenuContentImpl = React.forwardRef(
19406
19449
  onInteractOutside,
19407
19450
  onDismiss,
19408
19451
  children: /* @__PURE__ */ jsx(
19409
- Root$8,
19452
+ Root$9,
19410
19453
  {
19411
19454
  asChild: true,
19412
19455
  ...rovingFocusGroupScope,
@@ -29365,18 +29408,18 @@ const Mention = Node$1.create({
29365
29408
  return {
29366
29409
  id: {
29367
29410
  default: null,
29368
- parseHTML: (element) => element.getAttribute("data-id"),
29411
+ parseHTML: (element) => element.getAttribute("data-mention-id"),
29369
29412
  renderHTML: (attributes) => {
29370
29413
  if (!attributes.id) return {};
29371
- return { "data-id": attributes.id };
29414
+ return { "data-mention-id": attributes.id };
29372
29415
  }
29373
29416
  },
29374
29417
  label: {
29375
29418
  default: null,
29376
- parseHTML: (element) => element.getAttribute("data-label"),
29419
+ parseHTML: (element) => element.getAttribute("data-mention-label"),
29377
29420
  renderHTML: (attributes) => {
29378
29421
  if (!attributes.label) return {};
29379
- return { "data-label": attributes.label };
29422
+ return { "data-mention-label": attributes.label };
29380
29423
  }
29381
29424
  },
29382
29425
  mentionSuggestionChar: {
@@ -29386,14 +29429,70 @@ const Mention = Node$1.create({
29386
29429
  return { "data-mention-suggestion-char": attributes.mentionSuggestionChar };
29387
29430
  }
29388
29431
  },
29389
- avatar: { default: null, parseHTML: () => null, renderHTML: () => ({}) },
29390
- inThisThread: { default: 1, parseHTML: () => null, renderHTML: () => ({}) },
29391
- name: { default: null, parseHTML: () => null, renderHTML: () => ({}) },
29392
- selectId: { default: null, parseHTML: () => null, renderHTML: () => ({}) },
29393
- type: { default: null, parseHTML: () => null, renderHTML: () => ({}) },
29394
- from: { default: PostType.Post, parseHTML: () => null, renderHTML: () => ({}) },
29395
- isCrossExposureEnable: { default: null, parseHTML: () => null, renderHTML: () => ({}) },
29396
- matchStartPosition: { default: -1, parseHTML: () => null, renderHTML: () => ({}) }
29432
+ avatar: {
29433
+ default: null,
29434
+ parseHTML: (element) => element.getAttribute("data-mention-avatar"),
29435
+ renderHTML: (attributes) => {
29436
+ if (!attributes.avatar) return {};
29437
+ return { "data-mention-avatar": attributes.avatar };
29438
+ }
29439
+ },
29440
+ inThisThread: {
29441
+ default: 1,
29442
+ parseHTML: (element) => element.getAttribute("data-mention-in-this-thread"),
29443
+ renderHTML: (attributes) => {
29444
+ if (!attributes.inThisThread) return {};
29445
+ return { "data-mention-in-this-thread": attributes.inThisThread };
29446
+ }
29447
+ },
29448
+ name: {
29449
+ default: null,
29450
+ parseHTML: (element) => element.getAttribute("data-mention-name"),
29451
+ renderHTML: (attributes) => {
29452
+ if (!attributes.name) return {};
29453
+ return { "data-mention-name": attributes.name };
29454
+ }
29455
+ },
29456
+ selectId: {
29457
+ default: null,
29458
+ parseHTML: (element) => element.getAttribute("data-mention-select-id"),
29459
+ renderHTML: (attributes) => {
29460
+ if (!attributes.selectId) return {};
29461
+ return { "data-mention-select-id": attributes.selectId };
29462
+ }
29463
+ },
29464
+ type: {
29465
+ default: null,
29466
+ parseHTML: (element) => element.getAttribute("data-mention-type"),
29467
+ renderHTML: (attributes) => {
29468
+ if (!attributes.type) return {};
29469
+ return { "data-mention-type": attributes.type };
29470
+ }
29471
+ },
29472
+ from: {
29473
+ default: PostType.Post,
29474
+ parseHTML: (element) => element.getAttribute("data-mention-from"),
29475
+ renderHTML: (attributes) => {
29476
+ if (!attributes.from) return {};
29477
+ return { "data-mention-from": attributes.from };
29478
+ }
29479
+ },
29480
+ isCrossExposureEnable: {
29481
+ default: null,
29482
+ parseHTML: (element) => element.getAttribute("data-mention-is-cross-exposure-enable"),
29483
+ renderHTML: (attributes) => {
29484
+ if (!attributes.isCrossExposureEnable) return {};
29485
+ return { "data-mention-is-cross-exposure-enable": attributes.isCrossExposureEnable };
29486
+ }
29487
+ },
29488
+ matchStartPosition: {
29489
+ default: -1,
29490
+ parseHTML: (element) => element.getAttribute("data-mention-match-start-position"),
29491
+ renderHTML: (attributes) => {
29492
+ if (!attributes.matchStartPosition) return {};
29493
+ return { "data-mention-match-start-position": attributes.matchStartPosition };
29494
+ }
29495
+ }
29397
29496
  };
29398
29497
  },
29399
29498
  parseHTML() {
@@ -30500,8 +30599,16 @@ const configureMentionExtension = (api, mfs, store) => {
30500
30599
  },
30501
30600
  renderHTML({ node, suggestion, isFocused }) {
30502
30601
  const char = suggestion?.char ?? "@";
30602
+ const avatar = node?.attrs?.avatar;
30603
+ const type = node?.attrs?.type;
30604
+ const from = node?.attrs?.from;
30605
+ const inThisThread = node?.attrs?.inThisThread;
30606
+ const isCrossExposureEnable = node?.attrs?.isCrossExposureEnable;
30607
+ const matchStartPosition = node?.attrs?.matchStartPosition;
30608
+ const selectId = node?.attrs?.selectId;
30503
30609
  const label = node.attrs.label ?? node.attrs.id;
30504
30610
  const id = node.attrs.id;
30611
+ const name = node?.attrs?.name;
30505
30612
  const isRNWebView = isReactNativeWebView();
30506
30613
  const mentionClasses = char === "@" ? "inline-block rounded italic font-medium cursor-pointer transition-all duration-200 text-blue-700 dark:text-blue-300" : "inline-block rounded italic font-medium cursor-pointer transition-all duration-200 text-blue-700 dark:text-blue-300";
30507
30614
  const baseAttributes = {
@@ -30509,6 +30616,17 @@ const configureMentionExtension = (api, mfs, store) => {
30509
30616
  "data-id": id,
30510
30617
  "data-label": label,
30511
30618
  "data-mention-suggestion-char": char,
30619
+ // Newly added attributes
30620
+ "data-mention-id": id,
30621
+ "data-mention-label": label,
30622
+ "data-mention-avatar": avatar,
30623
+ "data-mention-in-this-thread": inThisThread,
30624
+ "data-mention-name": name,
30625
+ "data-mention-select-id": selectId,
30626
+ "data-mention-type": type,
30627
+ "data-mention-from": from,
30628
+ "data-mention-is-cross-exposure-enable": isCrossExposureEnable,
30629
+ "data-mention-match-start-position": matchStartPosition,
30512
30630
  class: mentionClasses
30513
30631
  };
30514
30632
  if (isRNWebView) {
@@ -31811,9 +31929,7 @@ const PostBuilderEditor = ({
31811
31929
  });
31812
31930
  return () => cancelAnimationFrame(frame);
31813
31931
  }, [editor, sessionId, editorTab]);
31814
- if (!isMounted || !editor) {
31815
- return /* @__PURE__ */ jsx("div", { className: "max-w-full w-full", "data-theme": "select-post-builder", children: /* @__PURE__ */ jsx("div", { className: "flex items-center justify-center p-8", children: /* @__PURE__ */ jsx("div", { className: "animate-pulse", children: "Loading editor..." }) }) });
31816
- }
31932
+ if (!isMounted || !editor) return /* @__PURE__ */ jsx(EditorSkeleton, {});
31817
31933
  return /* @__PURE__ */ jsx(AnalyticsSessionProvider, { sessionId, editorType: editorTab, placement, children: /* @__PURE__ */ jsxs("div", { className: "max-w-full w-full", "data-theme": "select-post-builder", children: [
31818
31934
  /* @__PURE__ */ jsx(EditorContext.Provider, { value: providerValue, children: openModal ? /* @__PURE__ */ jsx(
31819
31935
  PostBuilderEditorInstanceWithDialog,
@@ -31850,6 +31966,16 @@ const PostBuilderEditor = ({
31850
31966
  /* @__PURE__ */ jsx(Toaster2, { position: "top-center" })
31851
31967
  ] }) });
31852
31968
  };
31969
+ const EditorSkeleton = () => /* @__PURE__ */ jsx("div", { className: "max-w-full w-full", "data-theme": "select-post-builder", children: /* @__PURE__ */ jsxs("div", { className: "space-y-3", children: [
31970
+ /* @__PURE__ */ jsx(Skeleton, { className: "h-8 w-40" }),
31971
+ /* @__PURE__ */ jsxs("div", { className: "min-h-60 w-full flex flex-col overflow-hidden rounded-lg border", children: [
31972
+ /* @__PURE__ */ jsx(Skeleton, { className: "h-10 rounded-b-none" }),
31973
+ /* @__PURE__ */ jsx(Separator$1, {}),
31974
+ /* @__PURE__ */ jsx(Skeleton, { className: "h-44 rounded-none" }),
31975
+ /* @__PURE__ */ jsx(Separator$1, {}),
31976
+ /* @__PURE__ */ jsx(Skeleton, { className: "h-[47px] rounded-t-none flex items-center justify-end p-2", children: /* @__PURE__ */ jsx(Skeleton, { className: "h-full w-20 bg-accent-foreground/20" }) })
31977
+ ] })
31978
+ ] }) });
31853
31979
  const translationFallback = {
31854
31980
  // General
31855
31981
  addKey: "Add",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@select-org/select-post-builder",
3
- "version": "1.1.8",
3
+ "version": "1.1.10",
4
4
  "description": "A reusable, extensible Post Builder widget for the Select platform and beyond.",
5
5
  "main": "./dist/post-builder.cjs.js",
6
6
  "module": "./dist/post-builder.js",