@select-org/select-post-builder 1.1.9 → 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.
@@ -29438,18 +29438,18 @@ const Mention = core.Node.create({
29438
29438
  return {
29439
29439
  id: {
29440
29440
  default: null,
29441
- parseHTML: (element) => element.getAttribute("data-id"),
29441
+ parseHTML: (element) => element.getAttribute("data-mention-id"),
29442
29442
  renderHTML: (attributes) => {
29443
29443
  if (!attributes.id) return {};
29444
- return { "data-id": attributes.id };
29444
+ return { "data-mention-id": attributes.id };
29445
29445
  }
29446
29446
  },
29447
29447
  label: {
29448
29448
  default: null,
29449
- parseHTML: (element) => element.getAttribute("data-label"),
29449
+ parseHTML: (element) => element.getAttribute("data-mention-label"),
29450
29450
  renderHTML: (attributes) => {
29451
29451
  if (!attributes.label) return {};
29452
- return { "data-label": attributes.label };
29452
+ return { "data-mention-label": attributes.label };
29453
29453
  }
29454
29454
  },
29455
29455
  mentionSuggestionChar: {
@@ -29459,14 +29459,70 @@ const Mention = core.Node.create({
29459
29459
  return { "data-mention-suggestion-char": attributes.mentionSuggestionChar };
29460
29460
  }
29461
29461
  },
29462
- avatar: { default: null, parseHTML: () => null, renderHTML: () => ({}) },
29463
- inThisThread: { default: 1, parseHTML: () => null, renderHTML: () => ({}) },
29464
- name: { default: null, parseHTML: () => null, renderHTML: () => ({}) },
29465
- selectId: { default: null, parseHTML: () => null, renderHTML: () => ({}) },
29466
- type: { default: null, parseHTML: () => null, renderHTML: () => ({}) },
29467
- from: { default: PostType.Post, parseHTML: () => null, renderHTML: () => ({}) },
29468
- isCrossExposureEnable: { default: null, parseHTML: () => null, renderHTML: () => ({}) },
29469
- 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
+ }
29470
29526
  };
29471
29527
  },
29472
29528
  parseHTML() {
@@ -30573,8 +30629,16 @@ const configureMentionExtension = (api, mfs, store) => {
30573
30629
  },
30574
30630
  renderHTML({ node, suggestion: suggestion2, isFocused }) {
30575
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;
30576
30639
  const label = node.attrs.label ?? node.attrs.id;
30577
30640
  const id = node.attrs.id;
30641
+ const name = node?.attrs?.name;
30578
30642
  const isRNWebView = isReactNativeWebView();
30579
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";
30580
30644
  const baseAttributes = {
@@ -30582,6 +30646,17 @@ const configureMentionExtension = (api, mfs, store) => {
30582
30646
  "data-id": id,
30583
30647
  "data-label": label,
30584
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,
30585
30660
  class: mentionClasses
30586
30661
  };
30587
30662
  if (isRNWebView) {
@@ -29408,18 +29408,18 @@ const Mention = Node$1.create({
29408
29408
  return {
29409
29409
  id: {
29410
29410
  default: null,
29411
- parseHTML: (element) => element.getAttribute("data-id"),
29411
+ parseHTML: (element) => element.getAttribute("data-mention-id"),
29412
29412
  renderHTML: (attributes) => {
29413
29413
  if (!attributes.id) return {};
29414
- return { "data-id": attributes.id };
29414
+ return { "data-mention-id": attributes.id };
29415
29415
  }
29416
29416
  },
29417
29417
  label: {
29418
29418
  default: null,
29419
- parseHTML: (element) => element.getAttribute("data-label"),
29419
+ parseHTML: (element) => element.getAttribute("data-mention-label"),
29420
29420
  renderHTML: (attributes) => {
29421
29421
  if (!attributes.label) return {};
29422
- return { "data-label": attributes.label };
29422
+ return { "data-mention-label": attributes.label };
29423
29423
  }
29424
29424
  },
29425
29425
  mentionSuggestionChar: {
@@ -29429,14 +29429,70 @@ const Mention = Node$1.create({
29429
29429
  return { "data-mention-suggestion-char": attributes.mentionSuggestionChar };
29430
29430
  }
29431
29431
  },
29432
- avatar: { default: null, parseHTML: () => null, renderHTML: () => ({}) },
29433
- inThisThread: { default: 1, parseHTML: () => null, renderHTML: () => ({}) },
29434
- name: { default: null, parseHTML: () => null, renderHTML: () => ({}) },
29435
- selectId: { default: null, parseHTML: () => null, renderHTML: () => ({}) },
29436
- type: { default: null, parseHTML: () => null, renderHTML: () => ({}) },
29437
- from: { default: PostType.Post, parseHTML: () => null, renderHTML: () => ({}) },
29438
- isCrossExposureEnable: { default: null, parseHTML: () => null, renderHTML: () => ({}) },
29439
- 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
+ }
29440
29496
  };
29441
29497
  },
29442
29498
  parseHTML() {
@@ -30543,8 +30599,16 @@ const configureMentionExtension = (api, mfs, store) => {
30543
30599
  },
30544
30600
  renderHTML({ node, suggestion, isFocused }) {
30545
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;
30546
30609
  const label = node.attrs.label ?? node.attrs.id;
30547
30610
  const id = node.attrs.id;
30611
+ const name = node?.attrs?.name;
30548
30612
  const isRNWebView = isReactNativeWebView();
30549
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";
30550
30614
  const baseAttributes = {
@@ -30552,6 +30616,17 @@ const configureMentionExtension = (api, mfs, store) => {
30552
30616
  "data-id": id,
30553
30617
  "data-label": label,
30554
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,
30555
30630
  class: mentionClasses
30556
30631
  };
30557
30632
  if (isRNWebView) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@select-org/select-post-builder",
3
- "version": "1.1.9",
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",