@saasquatch/mint-components 2.1.10-57 → 2.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.
Files changed (156) hide show
  1. package/dist/cjs/{ShadowViewAddon-a26deae6.js → ShadowViewAddon-c97e80de.js} +422 -19
  2. package/dist/cjs/loader.cjs.js +1 -1
  3. package/dist/cjs/mint-components.cjs.js +1 -1
  4. package/dist/cjs/{sqm-big-stat_46.cjs.entry.js → sqm-big-stat_45.cjs.entry.js} +264 -92
  5. package/dist/cjs/sqm-code-verification.cjs.entry.js +1 -1
  6. package/dist/cjs/sqm-email-verification.cjs.entry.js +1 -1
  7. package/dist/cjs/sqm-empty_4.cjs.entry.js +1 -1
  8. package/dist/cjs/{sqm-portal-container-view-70a47420.js → sqm-portal-container-view-757f921b.js} +5 -6
  9. package/dist/cjs/{sqm-portal-email-verification-view-c81fe7f1.js → sqm-portal-email-verification-view-abb773a7.js} +1 -1
  10. package/dist/cjs/sqm-portal-email-verification.cjs.entry.js +2 -2
  11. package/dist/cjs/sqm-portal-forgot-password_6.cjs.entry.js +5 -5
  12. package/dist/cjs/{sqm-portal-profile-view-639337e3.js → sqm-portal-profile-view-3515e1e5.js} +1 -1
  13. package/dist/cjs/sqm-portal-profile.cjs.entry.js +2 -2
  14. package/dist/cjs/{sqm-portal-registration-form-view-020f661c.js → sqm-portal-registration-form-view-a45f7a52.js} +1 -1
  15. package/dist/cjs/{sqm-portal-reset-password-view-6b1acd90.js → sqm-portal-reset-password-view-a767b044.js} +1 -1
  16. package/dist/cjs/sqm-portal-reset-password.cjs.entry.js +2 -2
  17. package/dist/cjs/{sqm-portal-verify-email-view-424e406a.js → sqm-portal-verify-email-view-717d0633.js} +1 -1
  18. package/dist/cjs/sqm-referral-table_11.cjs.entry.js +1 -1
  19. package/dist/cjs/sqm-rewards-table-customer-note-cell.cjs.entry.js +1 -1
  20. package/dist/cjs/sqm-stencilbook.cjs.entry.js +168 -59
  21. package/dist/cjs/{sqm-text-span-view-f274fdf2.js → sqm-text-span-view-b9e10f5d.js} +1 -1
  22. package/dist/cjs/sqm-text-span.cjs.entry.js +1 -1
  23. package/dist/collection/collection-manifest.json +0 -1
  24. package/dist/collection/components/sqm-password-field/sqm-password-field.js +1 -0
  25. package/dist/collection/components/sqm-portal-container/sqm-portal-container-view.js +6 -7
  26. package/dist/collection/components/sqm-portal-google-login/sqm-portal-google-login.js +1 -1
  27. package/dist/collection/components/sqm-portal-login/sqm-portal-login.js +1 -1
  28. package/dist/collection/components/sqm-share-code/sqm-share-code.js +0 -1
  29. package/dist/collection/components/sqm-share-link/ShareLink.stories.js +136 -11
  30. package/dist/collection/components/sqm-share-link/UseShareLink.stories.js +14 -5
  31. package/dist/collection/components/sqm-share-link/sqm-share-link-view.js +192 -0
  32. package/dist/collection/components/sqm-share-link/sqm-share-link.js +935 -48
  33. package/dist/collection/components/sqm-share-link/useShareLink.js +227 -14
  34. package/dist/collection/components/sqm-stencilbook/sqm-stencilbook.js +0 -2
  35. package/dist/collection/components/sqm-text-span/sqm-text-span-view.js +1 -1
  36. package/dist/esm/{ShadowViewAddon-47f1e579.js → ShadowViewAddon-33f1a8f7.js} +424 -22
  37. package/dist/esm/loader.js +1 -1
  38. package/dist/esm/mint-components.js +1 -1
  39. package/dist/esm/{sqm-big-stat_46.entry.js → sqm-big-stat_45.entry.js} +265 -92
  40. package/dist/esm/sqm-code-verification.entry.js +1 -1
  41. package/dist/esm/sqm-email-verification.entry.js +1 -1
  42. package/dist/esm/sqm-empty_4.entry.js +1 -1
  43. package/dist/esm/{sqm-portal-container-view-a8c708cd.js → sqm-portal-container-view-200c9df8.js} +6 -7
  44. package/dist/esm/{sqm-portal-email-verification-view-426370f1.js → sqm-portal-email-verification-view-04528277.js} +1 -1
  45. package/dist/esm/sqm-portal-email-verification.entry.js +2 -2
  46. package/dist/esm/sqm-portal-forgot-password_6.entry.js +5 -5
  47. package/dist/esm/{sqm-portal-profile-view-f015fd6a.js → sqm-portal-profile-view-b5ea620f.js} +1 -1
  48. package/dist/esm/sqm-portal-profile.entry.js +2 -2
  49. package/dist/esm/{sqm-portal-registration-form-view-2f4936ef.js → sqm-portal-registration-form-view-79265df5.js} +1 -1
  50. package/dist/esm/{sqm-portal-reset-password-view-cfbc0eb0.js → sqm-portal-reset-password-view-f84c04cf.js} +1 -1
  51. package/dist/esm/sqm-portal-reset-password.entry.js +2 -2
  52. package/dist/esm/{sqm-portal-verify-email-view-1a638fae.js → sqm-portal-verify-email-view-c61536b7.js} +1 -1
  53. package/dist/esm/sqm-referral-table_11.entry.js +1 -1
  54. package/dist/esm/sqm-rewards-table-customer-note-cell.entry.js +1 -1
  55. package/dist/esm/sqm-stencilbook.entry.js +168 -59
  56. package/dist/esm/{sqm-text-span-view-738acfb3.js → sqm-text-span-view-72f43dff.js} +1 -1
  57. package/dist/esm/sqm-text-span.entry.js +1 -1
  58. package/dist/esm-es5/ShadowViewAddon-33f1a8f7.js +1 -0
  59. package/dist/esm-es5/loader.js +1 -1
  60. package/dist/esm-es5/mint-components.js +1 -1
  61. package/dist/esm-es5/sqm-big-stat_45.entry.js +1 -0
  62. package/dist/esm-es5/sqm-code-verification.entry.js +1 -1
  63. package/dist/esm-es5/sqm-email-verification.entry.js +1 -1
  64. package/dist/esm-es5/sqm-empty_4.entry.js +1 -1
  65. package/dist/esm-es5/sqm-portal-container-view-200c9df8.js +1 -0
  66. package/dist/esm-es5/{sqm-portal-email-verification-view-426370f1.js → sqm-portal-email-verification-view-04528277.js} +1 -1
  67. package/dist/esm-es5/sqm-portal-email-verification.entry.js +1 -1
  68. package/dist/esm-es5/sqm-portal-forgot-password_6.entry.js +1 -1
  69. package/dist/esm-es5/{sqm-portal-profile-view-f015fd6a.js → sqm-portal-profile-view-b5ea620f.js} +1 -1
  70. package/dist/esm-es5/sqm-portal-profile.entry.js +1 -1
  71. package/dist/esm-es5/{sqm-portal-registration-form-view-2f4936ef.js → sqm-portal-registration-form-view-79265df5.js} +1 -1
  72. package/dist/esm-es5/{sqm-portal-reset-password-view-cfbc0eb0.js → sqm-portal-reset-password-view-f84c04cf.js} +1 -1
  73. package/dist/esm-es5/sqm-portal-reset-password.entry.js +1 -1
  74. package/dist/esm-es5/{sqm-portal-verify-email-view-1a638fae.js → sqm-portal-verify-email-view-c61536b7.js} +1 -1
  75. package/dist/esm-es5/sqm-referral-table_11.entry.js +1 -1
  76. package/dist/esm-es5/sqm-rewards-table-customer-note-cell.entry.js +1 -1
  77. package/dist/esm-es5/sqm-stencilbook.entry.js +1 -1
  78. package/dist/esm-es5/{sqm-text-span-view-738acfb3.js → sqm-text-span-view-72f43dff.js} +1 -1
  79. package/dist/esm-es5/sqm-text-span.entry.js +1 -1
  80. package/dist/mint-components/mint-components.esm.js +1 -1
  81. package/dist/mint-components/{p-ab0ea688.system.entry.js → p-00b235c5.system.entry.js} +1 -1
  82. package/dist/mint-components/p-08930b83.js +499 -0
  83. package/dist/mint-components/p-0b1e90fe.system.js +1 -0
  84. package/dist/mint-components/p-1021a49f.system.entry.js +1 -0
  85. package/dist/mint-components/{p-25558a33.entry.js → p-13292317.entry.js} +1 -1
  86. package/dist/mint-components/{p-d65991d0.entry.js → p-13d1b10d.entry.js} +1 -1
  87. package/dist/mint-components/{p-d4570314.entry.js → p-1d92c169.entry.js} +1 -1
  88. package/dist/mint-components/{p-7161e1a6.js → p-2668335b.js} +1 -1
  89. package/dist/mint-components/{p-6e512063.entry.js → p-3af3e2c1.entry.js} +1 -1
  90. package/dist/mint-components/{p-5ff7b000.entry.js → p-40bad95a.entry.js} +1 -1
  91. package/dist/mint-components/{p-f35d856a.system.js → p-43c31fd5.system.js} +1 -1
  92. package/dist/mint-components/p-5bc5c61e.entry.js +1 -0
  93. package/dist/mint-components/{p-dac20392.system.js → p-686dd5eb.system.js} +1 -1
  94. package/dist/mint-components/{p-7b909aa5.system.js → p-7562cd98.system.js} +1 -1
  95. package/dist/mint-components/p-76271ec4.entry.js +9 -0
  96. package/dist/mint-components/p-78b40f71.system.js +1 -0
  97. package/dist/mint-components/{p-cb0a5990.entry.js → p-7939e4af.entry.js} +1 -1
  98. package/dist/mint-components/{p-e6ace3ab.js → p-832aea99.js} +1 -1
  99. package/dist/mint-components/{p-746500b2.entry.js → p-8784539d.entry.js} +21 -29
  100. package/dist/mint-components/{p-b9f57e84.system.entry.js → p-8899ff38.system.entry.js} +1 -1
  101. package/dist/mint-components/{p-fbe00c97.system.entry.js → p-892797eb.system.entry.js} +1 -1
  102. package/dist/mint-components/{p-d997001a.js → p-8962e023.js} +1 -1
  103. package/dist/mint-components/{p-dd368927.system.entry.js → p-9390586b.system.entry.js} +1 -1
  104. package/dist/mint-components/{p-3c46b4dd.system.js → p-a4825ec2.system.js} +1 -1
  105. package/dist/mint-components/{p-058aefe1.entry.js → p-af407cce.entry.js} +1 -1
  106. package/dist/mint-components/{p-56ca7e3c.js → p-b3ad957c.js} +1 -1
  107. package/dist/mint-components/{p-70570e4d.system.entry.js → p-b96e90a2.system.entry.js} +1 -1
  108. package/dist/mint-components/{p-c67f8558.system.entry.js → p-bba16a46.system.entry.js} +1 -1
  109. package/dist/mint-components/{p-669d52c4.js → p-bee4af5d.js} +1 -1
  110. package/dist/mint-components/p-c3c8d4ee.system.entry.js +1 -0
  111. package/dist/mint-components/{p-cabf6326.js → p-c813ec64.js} +1 -1
  112. package/dist/mint-components/p-ca098be1.system.js +1 -1
  113. package/dist/mint-components/{p-18133026.system.entry.js → p-d3b1ab20.system.entry.js} +1 -1
  114. package/dist/mint-components/{p-692e14c5.system.js → p-d55c50af.system.js} +1 -1
  115. package/dist/mint-components/p-dd12c32a.system.entry.js +1 -0
  116. package/dist/mint-components/p-e30abc44.js +1 -0
  117. package/dist/mint-components/{p-fb5c9802.entry.js → p-e506bf7f.entry.js} +1 -1
  118. package/dist/mint-components/{p-aefc6c4f.system.entry.js → p-e9485160.system.entry.js} +1 -1
  119. package/dist/mint-components/{p-f0baeed0.entry.js → p-f6528f8a.entry.js} +1 -1
  120. package/dist/mint-components/{p-5141769d.system.entry.js → p-f7ca4cc4.system.entry.js} +1 -1
  121. package/dist/mint-components/{p-e4f17c21.system.js → p-f8026ed6.system.js} +1 -1
  122. package/dist/types/components/sqm-share-link/ShareLink.stories.d.ts +9 -0
  123. package/dist/types/components/sqm-share-link/UseShareLink.stories.d.ts +6 -0
  124. package/dist/types/components/sqm-share-link/sqm-share-link-view.d.ts +41 -0
  125. package/dist/types/components/sqm-share-link/sqm-share-link.d.ts +195 -2
  126. package/dist/types/components/sqm-share-link/useShareLink.d.ts +33 -4
  127. package/dist/types/components.d.ts +349 -80
  128. package/dist/types/global/android.d.ts +7 -0
  129. package/dist/types/global/demo.d.ts +2 -0
  130. package/dist/types/stories/features.d.ts +4 -0
  131. package/dist/types/stories/templates.d.ts +4 -0
  132. package/docs/docs.docx +0 -0
  133. package/docs/raisins.json +1 -1
  134. package/docs/stats.json +122783 -0
  135. package/grapesjs/grapesjs.js +1 -1
  136. package/package.json +2 -2
  137. package/dist/collection/components/sqm-user-attribute/UserAttribute.stories.js +0 -25
  138. package/dist/collection/components/sqm-user-attribute/sqm-user-attribute-view.js +0 -19
  139. package/dist/collection/components/sqm-user-attribute/sqm-user-attribute.js +0 -172
  140. package/dist/collection/components/sqm-user-attribute/useUserAttribute.js +0 -26
  141. package/dist/esm-es5/ShadowViewAddon-47f1e579.js +0 -1
  142. package/dist/esm-es5/sqm-big-stat_46.entry.js +0 -1
  143. package/dist/esm-es5/sqm-portal-container-view-a8c708cd.js +0 -1
  144. package/dist/mint-components/p-217dedde.js +0 -463
  145. package/dist/mint-components/p-4007afba.system.entry.js +0 -1
  146. package/dist/mint-components/p-445f50cc.entry.js +0 -9
  147. package/dist/mint-components/p-55676213.entry.js +0 -1
  148. package/dist/mint-components/p-89a20547.system.entry.js +0 -1
  149. package/dist/mint-components/p-b699f76e.system.js +0 -1
  150. package/dist/mint-components/p-b6a1e2ac.js +0 -1
  151. package/dist/mint-components/p-ce050888.system.js +0 -1
  152. package/dist/mint-components/p-e3497e0e.system.entry.js +0 -1
  153. package/dist/types/components/sqm-user-attribute/UserAttribute.stories.d.ts +0 -7
  154. package/dist/types/components/sqm-user-attribute/sqm-user-attribute-view.d.ts +0 -8
  155. package/dist/types/components/sqm-user-attribute/sqm-user-attribute.d.ts +0 -45
  156. package/dist/types/components/sqm-user-attribute/useUserAttribute.d.ts +0 -3
@@ -10,13 +10,13 @@ const JSS = require('./JSS-8503a151.js');
10
10
  const useReferralCodes = require('./useReferralCodes-0f7948af.js');
11
11
  const mixins = require('./mixins-4761d472.js');
12
12
  const copyTextView = require('./copy-text-view-bb2c0ea7.js');
13
- const sqmTextSpanView = require('./sqm-text-span-view-f274fdf2.js');
13
+ const sqmTextSpanView = require('./sqm-text-span-view-b9e10f5d.js');
14
14
  const useChildElements = require('./useChildElements-041127d7.js');
15
15
  const luxon = require('./luxon-c1ad356a.js');
16
16
  const index$1 = require('./index-8c6255f5.js');
17
17
  const imageUrl$1 = require('./imageUrl-a7880cab.js');
18
18
  const utilities = require('./utilities-fcdb9504.js');
19
- const sqmPortalContainerView = require('./sqm-portal-container-view-70a47420.js');
19
+ const sqmPortalContainerView = require('./sqm-portal-container-view-757f921b.js');
20
20
 
21
21
  function BigStatView(props) {
22
22
  const { statvalue, flexReverse, alignment, statTextColor, statFontSize, descriptionTextColor, descriptionFontSize, statFontWeight, } = props;
@@ -4229,15 +4229,203 @@ function useShareButton(props) {
4229
4229
  };
4230
4230
  }
4231
4231
 
4232
+ const vanillaStyle$6 = `
4233
+ :host {
4234
+ display: block;
4235
+ width: 100%;
4236
+ }
4237
+ `;
4238
+ function ShareLinkView(props) {
4239
+ const { copyTextViewProps, allowCustomization, customizeLinkLabel, saveLabelText, savingLabelText, cancelLabelText, editLabelText, charactersRemainingText, validatingLabelText, isEditing, editValue, domainPrefix, editsRemaining, limitReached, validationError, isValidating, isSaving, characterLimit, minCharacters, charactersRemaining, editLimitText, editLimitReachedText, supportLinkText, customizeDisabled, customizeDisabledTooltip, onCustomizeClick, onEditValueChange, onSave, onCancel, minCharactersText, } = props;
4240
+ const style = {
4241
+ Container: {
4242
+ display: "flex",
4243
+ flexDirection: "column",
4244
+ gap: "var(--sl-spacing-xx-small)",
4245
+ width: "100%",
4246
+ },
4247
+ CustomizeLinkText: {
4248
+ paddingTop: "var(--sl-spacing-xx-small)",
4249
+ margin: "0",
4250
+ fontSize: "var(--sl-font-size-small)",
4251
+ fontWeight: "600",
4252
+ cursor: "pointer",
4253
+ color: "var(--sl-color-neutral-900)",
4254
+ textAlign: "left",
4255
+ "&:hover": {
4256
+ textDecoration: "underline",
4257
+ },
4258
+ },
4259
+ CustomizeLinkDisabled: {
4260
+ paddingTop: "var(--sl-spacing-xx-small)",
4261
+ margin: "0",
4262
+ fontSize: "var(--sl-font-size-small)",
4263
+ fontWeight: "600",
4264
+ color: "var(--sl-color-neutral-400)",
4265
+ cursor: "default",
4266
+ textAlign: "left",
4267
+ },
4268
+ EditContainer: {
4269
+ display: "flex",
4270
+ flexDirection: "column",
4271
+ gap: "var(--sl-spacing-x-small)",
4272
+ width: "100%",
4273
+ },
4274
+ EditInputWrapper: {
4275
+ display: "flex",
4276
+ alignItems: "center",
4277
+ width: "100%",
4278
+ border: "var(--sqm-border-thickness, 1px) solid var(--sqm-input-border-color, #d1d5db)",
4279
+ borderRadius: "var(--sqm-border-radius-normal, 4px)",
4280
+ background: "var(--sqm-input-background, #fff)",
4281
+ overflow: "hidden",
4282
+ "&:focus-within": {
4283
+ borderColor: "#999999",
4284
+ boxShadow: "0 0 0 var(--sl-focus-ring-width) var(--sl-input-focus-ring-color)",
4285
+ },
4286
+ },
4287
+ DomainPrefix: {
4288
+ padding: "0 0 0 var(--sl-spacing-medium)",
4289
+ fontSize: "var(--sl-font-size-medium)",
4290
+ color: "var(--sl-color-neutral-500)",
4291
+ whiteSpace: "nowrap",
4292
+ userSelect: "none",
4293
+ lineHeight: "var(--sl-input-height-medium)",
4294
+ },
4295
+ EditInput: {
4296
+ "&::part(base)": {
4297
+ border: "none",
4298
+ borderRadius: "0",
4299
+ },
4300
+ "&::part(input)": {
4301
+ margin: 0,
4302
+ },
4303
+ },
4304
+ EditLabel: {
4305
+ margin: "0",
4306
+ fontSize: "var(--sl-font-size-small)",
4307
+ color: "var(--sl-color-neutral-500)",
4308
+ },
4309
+ HelperText: {
4310
+ paddingTop: "var(--sl-spacing-xx-small)",
4311
+ margin: "0",
4312
+ fontSize: "var(--sl-font-size-small)",
4313
+ color: "var(--sl-color-neutral-500)",
4314
+ },
4315
+ ErrorText: {
4316
+ margin: "0",
4317
+ fontSize: "var(--sl-font-size-small)",
4318
+ color: "var(--sqm-danger-color-text, #dc2626)",
4319
+ },
4320
+ ActionRow: {
4321
+ display: "flex",
4322
+ gap: "var(--sl-spacing-medium)",
4323
+ alignItems: "center",
4324
+ },
4325
+ SaveButton: {
4326
+ cursor: "pointer",
4327
+ fontFamily: "var(--sl-font-sans)",
4328
+ fontSize: "var(--sl-font-size-small)",
4329
+ fontWeight: "600",
4330
+ padding: "var(--sl-spacing-x-small) var(--sl-spacing-medium)",
4331
+ borderRadius: "var(--sqm-border-radius-normal, 4px)",
4332
+ border: "1px solid var(--sl-color-neutral-900)",
4333
+ background: "var(--sl-color-neutral-900)",
4334
+ color: "#fff",
4335
+ "&:disabled": {
4336
+ opacity: "0.5",
4337
+ cursor: "default",
4338
+ },
4339
+ },
4340
+ CancelButton: {
4341
+ margin: "0",
4342
+ fontSize: "var(--sl-font-size-small)",
4343
+ fontWeight: "600",
4344
+ cursor: "pointer",
4345
+ background: "none",
4346
+ border: "none",
4347
+ fontFamily: "var(--sl-font-sans)",
4348
+ color: "var(--sl-color-neutral-500)",
4349
+ "&::part(label)": {
4350
+ padding: "0",
4351
+ },
4352
+ },
4353
+ LimitReachedContainer: {
4354
+ display: "flex",
4355
+ alignItems: "center",
4356
+ gap: "var(--sl-spacing-x-small)",
4357
+ },
4358
+ };
4359
+ const sheet = JSS.createStyleSheet(style);
4360
+ const styleString = sheet.toString();
4361
+ const errorMessageType = (validationError === null || validationError === void 0 ? void 0 : validationError.code) === "EXISTING_CODE_CONFLICT" ? "info" : "warning";
4362
+ const showCharactersRemaining = charactersRemaining <= 14;
4363
+ const editLimitMessage = global.intl.formatMessage({
4364
+ id: "editLimitText",
4365
+ defaultMessage: editLimitText,
4366
+ }, { editsRemaining });
4367
+ // Editing state
4368
+ if (isEditing) {
4369
+ return (index.h("div", { class: sheet.classes.Container },
4370
+ index.h("style", { type: "text/css" },
4371
+ styleString,
4372
+ vanillaStyle$6),
4373
+ index.h("p", { class: sheet.classes.EditLabel }, editLabelText),
4374
+ index.h("div", { class: sheet.classes.EditInputWrapper },
4375
+ index.h("span", { class: sheet.classes.DomainPrefix }, domainPrefix),
4376
+ index.h("sl-input", { class: sheet.classes.EditInput, type: "text", value: editValue, onInput: (e) => onEditValueChange(e.target.value), onKeyDown: (e) => {
4377
+ if (e.key === "/" || e.key === "@")
4378
+ e.preventDefault();
4379
+ }, disabled: isSaving, maxLength: characterLimit })),
4380
+ index.h("p", { class: sheet.classes.HelperText },
4381
+ editLimitMessage,
4382
+ " ",
4383
+ charactersRemaining > 12 && minCharactersText,
4384
+ showCharactersRemaining &&
4385
+ ` ${global.intl.formatMessage({
4386
+ id: "charactersRemainingText",
4387
+ defaultMessage: charactersRemainingText,
4388
+ }, { charactersRemaining })}`),
4389
+ validationError && (index.h("sqm-form-message", { type: errorMessageType, style: { paddingBottom: "var(--sl-spacing-xx-small)" } },
4390
+ index.h("p", { part: "alert-title" }, validationError.title),
4391
+ validationError.description)),
4392
+ isValidating && (index.h("p", { class: sheet.classes.HelperText }, validatingLabelText)),
4393
+ index.h("div", { class: sheet.classes.ActionRow },
4394
+ index.h("button", { class: sheet.classes.SaveButton, onClick: onSave, disabled: isSaving ||
4395
+ isValidating ||
4396
+ !!validationError ||
4397
+ !editValue ||
4398
+ editValue.length < minCharacters }, isSaving ? savingLabelText : saveLabelText),
4399
+ index.h("sl-button", { type: "text", class: sheet.classes.CancelButton, onClick: onCancel, disabled: isSaving }, cancelLabelText))));
4400
+ }
4401
+ // Default / Customized / Limit reached states
4402
+ return (index.h("div", { class: sheet.classes.Container },
4403
+ index.h("style", { type: "text/css" },
4404
+ styleString,
4405
+ vanillaStyle$6),
4406
+ index.h(copyTextView.CopyTextView, Object.assign({}, copyTextViewProps)),
4407
+ allowCustomization &&
4408
+ (customizeDisabled ? (index.h("sl-tooltip", { content: customizeDisabledTooltip, placement: "top", style: { display: "inline-block", width: "fit-content" } },
4409
+ index.h("p", { class: sheet.classes.CustomizeLinkDisabled }, customizeLinkLabel))) : (index.h("div", { class: sheet.classes.LimitReachedContainer },
4410
+ index.h("p", { class: limitReached
4411
+ ? sheet.classes.CustomizeLinkDisabled
4412
+ : sheet.classes.CustomizeLinkText, onClick: limitReached ? undefined : onCustomizeClick }, customizeLinkLabel),
4413
+ allowCustomization && limitReached && (index.h("p", { class: sheet.classes.HelperText }, global.intl.formatMessage({
4414
+ id: "editLimitReached",
4415
+ defaultMessage: editLimitReachedText,
4416
+ }, {
4417
+ supportLink: (index.h("a", { target: "_blank", href: "https://help.impact.com/other/readme/get-help-and-support" }, supportLinkText)),
4418
+ }))))))));
4419
+ }
4420
+
4421
+ const MAX_EDITS = 5;
4422
+ const CHARACTER_LIMIT = 15;
4423
+ const MIN_CHARACTERS = 3;
4232
4424
  const MessageLinkQuery$1 = index_module.dist.gql `
4233
- query ($programId: ID, $engagementMedium: UserEngagementMedium!) {
4425
+ query ($programId: ID) {
4234
4426
  user: viewer {
4235
4427
  ... on User {
4236
- shareLink(
4237
- programId: $programId
4238
- engagementMedium: $engagementMedium
4239
- shareMedium: DIRECT
4240
- )
4428
+ shareLink(programId: $programId)
4241
4429
  }
4242
4430
  }
4243
4431
  }
@@ -4247,19 +4435,115 @@ const WIDGET_ENGAGEMENT_EVENT = index_module.dist.gql `
4247
4435
  createUserAnalyticsEvent(eventMeta: $eventMeta)
4248
4436
  }
4249
4437
  `;
4438
+ const ADD_SHARE_LINK_CODE = index_module.dist.gql `
4439
+ mutation ($addShareLinkCodeInput: AddShareLinkCodeInput!) {
4440
+ addShareLinkCode(addShareLinkCodeInput: $addShareLinkCodeInput) {
4441
+ linkCode {
4442
+ linkCode
4443
+ shortUrl
4444
+ referralCode {
4445
+ code
4446
+ }
4447
+ }
4448
+ }
4449
+ }
4450
+ `;
4451
+ const VALIDATE_LINK_CODE = index_module.dist.gql `
4452
+ query validateLinkCode($linkCode: String!) {
4453
+ validateLinkCode(linkCode: $linkCode) {
4454
+ valid
4455
+ invalidReason
4456
+ }
4457
+ }
4458
+ `;
4459
+ const GET_LINK_DOMAIN = index_module.dist.gql `
4460
+ query getLinkDomain {
4461
+ tenantSettings {
4462
+ primaryLinkDomain {
4463
+ host
4464
+ }
4465
+ }
4466
+ }
4467
+ `;
4468
+ const SHARE_LINK_EDIT_COUNT = index_module.dist.gql `
4469
+ query shareLinkEditCount {
4470
+ viewer {
4471
+ ... on User {
4472
+ shareLinkCodes {
4473
+ totalCount
4474
+ data {
4475
+ isVanity
4476
+ }
4477
+ }
4478
+ }
4479
+ }
4480
+ }
4481
+ `;
4482
+ function parseShareUrl(url) {
4483
+ try {
4484
+ const parsed = new URL(url);
4485
+ return {
4486
+ url: parsed.origin + parsed.pathname,
4487
+ domain: parsed.origin + "/",
4488
+ path: parsed.pathname.slice(1),
4489
+ };
4490
+ }
4491
+ catch {
4492
+ return { url, domain: url, path: "" };
4493
+ }
4494
+ }
4250
4495
  function useShareLink(props) {
4251
- var _a, _b;
4496
+ var _a, _b, _c, _d, _e, _f, _g;
4252
4497
  const { programId = index_module.H() } = props;
4253
4498
  const user = index_module.J();
4254
4499
  const engagementMedium = index_module.B();
4255
4500
  const contextData = index_module.Fn(useReferralCodes.REFERRAL_CODES_NAMESPACE);
4256
- const { data } = index_module.wn(MessageLinkQuery$1, { programId, engagementMedium }, !(user === null || user === void 0 ? void 0 : user.jwt) || !!props.linkOverride || (contextData === null || contextData === void 0 ? void 0 : contextData.shareLink) !== undefined);
4501
+ const { data, refetch } = index_module.wn(MessageLinkQuery$1, { programId }, !(user === null || user === void 0 ? void 0 : user.jwt) || !!props.linkOverride || (contextData === null || contextData === void 0 ? void 0 : contextData.shareLink) !== undefined);
4257
4502
  const [sendLoadEvent] = index_module.$e(WIDGET_ENGAGEMENT_EVENT);
4258
- const [setCopied, copiedRes] = index_module.$e(useReferralCodes.SET_CODE_COPIED);
4259
- const copyString = (_b = ((contextData === null || contextData === void 0 ? void 0 : contextData.shareLink) || ((_a = data === null || data === void 0 ? void 0 : data.user) === null || _a === void 0 ? void 0 : _a.shareLink))) !== null && _b !== void 0 ? _b :
4503
+ const [setCopied] = index_module.$e(useReferralCodes.SET_CODE_COPIED);
4504
+ const [addShareLinkCode, { loading: isSaving }] = index_module.$e(ADD_SHARE_LINK_CODE);
4505
+ const [validateLinkCode] = index_module.Xe(VALIDATE_LINK_CODE);
4506
+ const { refresh } = index_module.Qe();
4507
+ const { data: linkDomainData } = index_module.wn(GET_LINK_DOMAIN, {}, !(user === null || user === void 0 ? void 0 : user.jwt) || !props.allowCustomization);
4508
+ const { data: editCountData, refetch: refetchEditCount } = index_module.wn(SHARE_LINK_EDIT_COUNT, {}, !(user === null || user === void 0 ? void 0 : user.jwt) || !props.allowCustomization);
4509
+ const { url: copyString, domain: domainPrefix, path: pathSuffix, } = parseShareUrl((_b = ((contextData === null || contextData === void 0 ? void 0 : contextData.shareLink) || ((_a = data === null || data === void 0 ? void 0 : data.user) === null || _a === void 0 ? void 0 : _a.shareLink))) !== null && _b !== void 0 ? _b :
4260
4510
  // Shown during loading
4261
- "...";
4511
+ "...");
4262
4512
  const [open, setOpen] = domContextHooks_module.useState(false);
4513
+ const [isEditing, setIsEditing] = domContextHooks_module.useState(false);
4514
+ const [editValue, setEditValue] = domContextHooks_module.useState("");
4515
+ const [validationError, setValidationError] = domContextHooks_module.useState(null);
4516
+ const [isValidating, setIsValidating] = domContextHooks_module.useState(false);
4517
+ const debounceTimerRef = domContextHooks_module.useRef(undefined);
4518
+ const latestValidationValueRef = domContextHooks_module.useRef("");
4519
+ const hasPrimaryLinkDomain = ((_c = linkDomainData === null || linkDomainData === void 0 ? void 0 : linkDomainData.tenantSettings) === null || _c === void 0 ? void 0 : _c.primaryLinkDomain) != null;
4520
+ const customizeDisabled = !hasPrimaryLinkDomain;
4521
+ const vanityCount = (_g = (_f = (_e = (_d = editCountData === null || editCountData === void 0 ? void 0 : editCountData.viewer) === null || _d === void 0 ? void 0 : _d.shareLinkCodes) === null || _e === void 0 ? void 0 : _e.data) === null || _f === void 0 ? void 0 : _f.filter((code) => code.isVanity).length) !== null && _g !== void 0 ? _g : 0;
4522
+ const editCount = vanityCount;
4523
+ const editsRemaining = Math.max(0, MAX_EDITS - editCount);
4524
+ const limitReached = editsRemaining <= 0;
4525
+ function mapErrorCodeToInfo(errorCode) {
4526
+ if (!errorCode)
4527
+ return null;
4528
+ const errorMap = {
4529
+ EXISTING_CODE_CONFLICT: {
4530
+ code: "EXISTING_CODE_CONFLICT",
4531
+ title: props.linkTakenErrorTitle,
4532
+ description: props.linkTakenErrorDescription,
4533
+ },
4534
+ INVALID_CHARACTER: {
4535
+ code: "INVALID_CHARACTER",
4536
+ title: props.invalidCharactersErrorTitle,
4537
+ description: props.invalidCharactersErrorDescription,
4538
+ },
4539
+ BLOCKED_WORD: {
4540
+ code: "BLOCKED_WORD",
4541
+ title: props.restrictedWordsErrorTitle,
4542
+ description: props.restrictedWordsErrorDescription,
4543
+ },
4544
+ };
4545
+ return errorMap[errorCode];
4546
+ }
4263
4547
  async function onClick() {
4264
4548
  if (contextData) {
4265
4549
  await setCopied({ referralCode: contextData.referralCode });
@@ -4283,7 +4567,125 @@ function useShareLink(props) {
4283
4567
  },
4284
4568
  });
4285
4569
  }
4286
- return { ...props, onClick, open, copyString: copyString };
4570
+ function onCustomizeClick() {
4571
+ if (limitReached || customizeDisabled)
4572
+ return;
4573
+ setIsEditing(true);
4574
+ setEditValue(editCount === 0 ? "" : pathSuffix);
4575
+ setValidationError(null);
4576
+ }
4577
+ function onEditValueChange(value) {
4578
+ const trimmed = value.slice(0, CHARACTER_LIMIT);
4579
+ setEditValue(trimmed);
4580
+ setValidationError(null);
4581
+ latestValidationValueRef.current = trimmed;
4582
+ if (debounceTimerRef.current)
4583
+ clearTimeout(debounceTimerRef.current);
4584
+ if (!trimmed || trimmed.length < MIN_CHARACTERS) {
4585
+ setIsValidating(false);
4586
+ return;
4587
+ }
4588
+ setIsValidating(true);
4589
+ debounceTimerRef.current = setTimeout(async () => {
4590
+ var _a, _b;
4591
+ const requestedValue = trimmed;
4592
+ try {
4593
+ const result = await validateLinkCode({ linkCode: requestedValue });
4594
+ // Discard stale responses if the user has continued typing
4595
+ if (latestValidationValueRef.current !== requestedValue)
4596
+ return;
4597
+ if (!((_a = result === null || result === void 0 ? void 0 : result.validateLinkCode) === null || _a === void 0 ? void 0 : _a.valid)) {
4598
+ const reason = (_b = result === null || result === void 0 ? void 0 : result.validateLinkCode) === null || _b === void 0 ? void 0 : _b.invalidReason;
4599
+ setValidationError(mapErrorCodeToInfo(reason));
4600
+ }
4601
+ }
4602
+ catch {
4603
+ // Validation query failed — don't block the user
4604
+ if (latestValidationValueRef.current !== requestedValue)
4605
+ return;
4606
+ }
4607
+ if (latestValidationValueRef.current === requestedValue) {
4608
+ setIsValidating(false);
4609
+ }
4610
+ }, 500);
4611
+ }
4612
+ async function onSave() {
4613
+ var _a, _b;
4614
+ if (!editValue ||
4615
+ editValue.length < MIN_CHARACTERS ||
4616
+ validationError ||
4617
+ isValidating)
4618
+ return;
4619
+ try {
4620
+ await addShareLinkCode({
4621
+ addShareLinkCodeInput: {
4622
+ userId: user === null || user === void 0 ? void 0 : user.id,
4623
+ accountId: user === null || user === void 0 ? void 0 : user.accountId,
4624
+ programId,
4625
+ linkCode: editValue,
4626
+ makeShareLinkCodePrimaryForReferralCode: true,
4627
+ },
4628
+ });
4629
+ setIsEditing(false);
4630
+ await Promise.all([refetch(), refetchEditCount()]);
4631
+ refresh();
4632
+ }
4633
+ catch (e) {
4634
+ const errorCode = (_a = e === null || e === void 0 ? void 0 : e.extensions) === null || _a === void 0 ? void 0 : _a.code;
4635
+ setValidationError((_b = mapErrorCodeToInfo(errorCode)) !== null && _b !== void 0 ? _b : {
4636
+ code: null,
4637
+ title: props.saveErrorTitle,
4638
+ description: (e === null || e === void 0 ? void 0 : e.message) || props.saveErrorDescription,
4639
+ });
4640
+ }
4641
+ }
4642
+ function onCancel() {
4643
+ setIsEditing(false);
4644
+ setEditValue("");
4645
+ setValidationError(null);
4646
+ setIsValidating(false);
4647
+ latestValidationValueRef.current = "";
4648
+ if (debounceTimerRef.current)
4649
+ clearTimeout(debounceTimerRef.current);
4650
+ }
4651
+ return {
4652
+ copyTextViewProps: {
4653
+ ...props,
4654
+ onClick,
4655
+ open,
4656
+ copyString,
4657
+ },
4658
+ minCharactersText: props.minCharactersText,
4659
+ allowCustomization: props.allowCustomization,
4660
+ customizeLinkLabel: props.customizeLinkButtonLabel,
4661
+ saveLabelText: props.saveLabelText,
4662
+ savingLabelText: props.savingLabelText,
4663
+ cancelLabelText: props.cancelLabelText,
4664
+ editLabelText: props.editLabelText,
4665
+ charactersRemainingText: props.charactersRemainingText,
4666
+ validatingLabelText: props.validatingLabelText,
4667
+ isEditing,
4668
+ editValue,
4669
+ domainPrefix,
4670
+ editsRemaining,
4671
+ maxEdits: MAX_EDITS,
4672
+ limitReached,
4673
+ validationError,
4674
+ isValidating,
4675
+ isSaving,
4676
+ characterLimit: CHARACTER_LIMIT,
4677
+ minCharacters: MIN_CHARACTERS,
4678
+ charactersRemaining: CHARACTER_LIMIT - editValue.length,
4679
+ editLimitText: props.editLimitText,
4680
+ editLimitReachedText: props.editLimitReachedText,
4681
+ supportLinkText: props.supportLinkText,
4682
+ customizeDisabled,
4683
+ customizeDisabledTooltip: props.customizeDisabledTooltip,
4684
+ onCustomizeClick,
4685
+ onEditValueChange,
4686
+ onSave,
4687
+ onCancel,
4688
+ };
4287
4689
  }
4288
4690
 
4289
4691
  const style$9 = {
@@ -4324,7 +4726,7 @@ const style$9 = {
4324
4726
  },
4325
4727
  ErrorStyle: mixins.ErrorStyles,
4326
4728
  };
4327
- const vanillaStyle$6 = `
4729
+ const vanillaStyle$7 = `
4328
4730
  sqm-portal-register {
4329
4731
  margin: 0 auto;
4330
4732
  width: 100%;
@@ -4356,7 +4758,7 @@ function LeadFormView(props) {
4356
4758
  return (index.h(index.Fragment, null,
4357
4759
  states.success && (index.h("div", { class: sheet$9.classes.Wrapper, part: "sqm-base" },
4358
4760
  index.h("style", { type: "text/css" },
4359
- vanillaStyle$6,
4761
+ vanillaStyle$7,
4360
4762
  styleString$9),
4361
4763
  index.h(sqmTextSpanView.TextSpanView, { type: "h3" }, content.pageLabel),
4362
4764
  index.h("sqm-form-message", { loading: states.loading, exportparts: "success-icon" },
@@ -4366,7 +4768,7 @@ function LeadFormView(props) {
4366
4768
  index.h("sl-button", { class: sheet$9.classes.ContinueButton, onClick: callbacks.resetForm, loading: states.loading, exportparts: "base: primarybutton-base", type: "default" }, content.resubmitFormLabel))),
4367
4769
  index.h("div", { class: sheet$9.classes.Wrapper, part: "sqm-base", style: { display: states.success ? "none" : "block" } },
4368
4770
  index.h("style", { type: "text/css" },
4369
- vanillaStyle$6,
4771
+ vanillaStyle$7,
4370
4772
  styleString$9),
4371
4773
  index.h(sqmTextSpanView.TextSpanView, { type: "h3" }, content.pageLabel),
4372
4774
  index.h("sl-form", { class: sheet$9.classes.Column, "onSl-submit": callbacks.submit, ref: (el) => (refs.formRef.current = el), novalidate: true },
@@ -4419,7 +4821,7 @@ const style$a = {
4419
4821
  "margin-bottom": "var(--sl-spacing-large)",
4420
4822
  },
4421
4823
  };
4422
- const vanillaStyle$7 = `
4824
+ const vanillaStyle$8 = `
4423
4825
  :host {
4424
4826
  margin: 0 auto;
4425
4827
  width: 100%;
@@ -4448,7 +4850,7 @@ function LeadDropdownFieldView(props) {
4448
4850
  });
4449
4851
  return (index.h("div", { class: sheet$a.classes.FieldContainer, part: "sqm-base" },
4450
4852
  index.h("style", { type: "text/css" },
4451
- vanillaStyle$7,
4853
+ vanillaStyle$8,
4452
4854
  styleString$a),
4453
4855
  index.h("sl-select", Object.assign({ style: { maxHeight: "100px" }, exportparts: "label: input-label, base: input-base", label: `${content.dropdownLabel}${content.dropdownOptional ? ` ${content.optionalLabel}` : ""}`, name: `/${content.dropdownName}`, multiple: content.multiple }, (!content.dropdownOptional ? { required: true } : []), { disabled: ((_b = states.leadFormState) === null || _b === void 0 ? void 0 : _b.loading) || ((_c = states.leadFormState) === null || _c === void 0 ? void 0 : _c.disabled), validationError: ({ value }) => {
4454
4856
  if (!value && !content.dropdownOptional) {
@@ -4523,6 +4925,7 @@ exports.ReferralIframeView = ReferralIframeView;
4523
4925
  exports.RewardExchangeView = RewardExchangeView;
4524
4926
  exports.ShadowViewAddon = ShadowViewAddon;
4525
4927
  exports.ShareButtonView = ShareButtonView;
4928
+ exports.ShareLinkView = ShareLinkView;
4526
4929
  exports.StatContainerView = StatContainerView;
4527
4930
  exports.TaskCardView = TaskCardView;
4528
4931
  exports.chooseAmountFixed = chooseAmountFixed;