@saasquatch/mint-components 2.1.8-22 → 2.1.8-24

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 (77) hide show
  1. package/dist/cjs/{ShadowViewAddon-643b83e2.js → ShadowViewAddon-1ed8faf9.js} +12 -8
  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_45.cjs.entry.js +4 -4
  5. package/dist/cjs/sqm-stencilbook.cjs.entry.js +590 -1146
  6. package/dist/collection/components/sqm-share-link/ShareLink.stories.js +1 -1
  7. package/dist/collection/components/sqm-share-link/UseShareLink.stories.js +1 -1
  8. package/dist/collection/components/sqm-share-link/sqm-share-link-view.js +37 -7
  9. package/dist/collection/components/sqm-share-link/sqm-share-link.js +24 -7
  10. package/dist/collection/components/sqm-share-link/useShareLink.js +3 -3
  11. package/dist/esm/{ShadowViewAddon-fcb6446a.js → ShadowViewAddon-395ab799.js} +12 -8
  12. package/dist/esm/loader.js +1 -1
  13. package/dist/esm/mint-components.js +1 -1
  14. package/dist/esm/sqm-big-stat_45.entry.js +4 -4
  15. package/dist/esm/sqm-stencilbook.entry.js +2773 -3329
  16. package/dist/esm-es5/{ShadowViewAddon-fcb6446a.js → ShadowViewAddon-395ab799.js} +1 -1
  17. package/dist/esm-es5/loader.js +1 -1
  18. package/dist/esm-es5/mint-components.js +1 -1
  19. package/dist/esm-es5/sqm-big-stat_45.entry.js +1 -1
  20. package/dist/esm-es5/sqm-stencilbook.entry.js +1 -1
  21. package/dist/mint-components/mint-components.esm.js +1 -1
  22. package/dist/mint-components/{p-3692c0da.system.entry.js → p-2b108f39.system.entry.js} +1 -1
  23. package/dist/mint-components/p-4b365f1f.system.js +1 -1
  24. package/dist/mint-components/{p-8d7548fb.system.entry.js → p-8e5a6491.system.entry.js} +1 -1
  25. package/dist/mint-components/{p-04502b80.entry.js → p-ba640335.entry.js} +2 -2
  26. package/dist/mint-components/{p-0eeb5438.js → p-cd79864c.js} +6 -6
  27. package/dist/mint-components/{p-5284bb02.system.js → p-d7adb7f3.system.js} +1 -1
  28. package/dist/mint-components/{p-31757712.entry.js → p-e6cf9daa.entry.js} +2 -2
  29. package/dist/types/components/sqm-share-link/sqm-share-link-view.d.ts +1 -1
  30. package/dist/types/components/sqm-share-link/sqm-share-link.d.ts +2 -1
  31. package/dist/types/components/sqm-share-link/useShareLink.d.ts +1 -1
  32. package/dist/types/components.d.ts +18 -234
  33. package/dist/types/global/android.d.ts +7 -0
  34. package/dist/types/global/demo.d.ts +2 -0
  35. package/dist/types/stories/features.d.ts +4 -0
  36. package/dist/types/stories/templates.d.ts +4 -0
  37. package/docs/docs.docx +0 -0
  38. package/docs/raisins.json +1 -1
  39. package/grapesjs/grapesjs.js +1 -1
  40. package/package.json +1 -1
  41. package/dist/cjs/sqm-share-link.cjs.entry.js +0 -271
  42. package/dist/cjs/useShareLink-1282123e.js +0 -422
  43. package/dist/cjs/useShareLink-3c22b1b9.js +0 -448
  44. package/dist/cjs/useShareLink-54e24928.js +0 -448
  45. package/dist/cjs/useShareLink-b664fbc7.js +0 -450
  46. package/dist/cjs/useShareLink-bf04b25c.js +0 -450
  47. package/dist/cjs/useShareLink-e8e2ae6d.js +0 -448
  48. package/dist/esm/sqm-share-link.entry.js +0 -267
  49. package/dist/esm/useShareLink-023284f3.js +0 -445
  50. package/dist/esm/useShareLink-436e9cad.js +0 -445
  51. package/dist/esm/useShareLink-4ba01373.js +0 -447
  52. package/dist/esm/useShareLink-79056582.js +0 -445
  53. package/dist/esm/useShareLink-a3329e33.js +0 -419
  54. package/dist/esm/useShareLink-bc20ec4c.js +0 -447
  55. package/dist/esm-es5/sqm-share-link.entry.js +0 -1
  56. package/dist/esm-es5/useShareLink-023284f3.js +0 -1
  57. package/dist/esm-es5/useShareLink-436e9cad.js +0 -1
  58. package/dist/esm-es5/useShareLink-4ba01373.js +0 -1
  59. package/dist/esm-es5/useShareLink-79056582.js +0 -1
  60. package/dist/esm-es5/useShareLink-a3329e33.js +0 -1
  61. package/dist/esm-es5/useShareLink-bc20ec4c.js +0 -1
  62. package/dist/mint-components/sqm-share-link.entry.js +0 -267
  63. package/dist/mint-components/sqm-share-link.system.entry.js +0 -1
  64. package/dist/mint-components/sqm-stencilbook.entry.js +0 -22106
  65. package/dist/mint-components/sqm-stencilbook.system.entry.js +0 -1
  66. package/dist/mint-components/useShareLink-023284f3.js +0 -445
  67. package/dist/mint-components/useShareLink-1d7c9fd8.system.js +0 -1
  68. package/dist/mint-components/useShareLink-211e061c.system.js +0 -1
  69. package/dist/mint-components/useShareLink-2de7ffce.system.js +0 -1
  70. package/dist/mint-components/useShareLink-436e9cad.js +0 -445
  71. package/dist/mint-components/useShareLink-454939f5.system.js +0 -1
  72. package/dist/mint-components/useShareLink-4ba01373.js +0 -447
  73. package/dist/mint-components/useShareLink-79056582.js +0 -445
  74. package/dist/mint-components/useShareLink-a3329e33.js +0 -419
  75. package/dist/mint-components/useShareLink-bc20ec4c.js +0 -447
  76. package/dist/mint-components/useShareLink-c05fe151.system.js +0 -1
  77. package/dist/mint-components/useShareLink-cb5abd96.system.js +0 -1
@@ -1,445 +0,0 @@
1
- import { h } from './index-d9876cd5.js';
2
- import { i as intl } from './global-e1c1ff72.js';
3
- import { i as useState, k as useRef } from './dom-context-hooks.module-8411297a.js';
4
- import { d as dist, H, J, B, F as Fn, w as wn, $ as $e, X as Xe, h as Qe } from './index.module-60e4da3a.js';
5
- import { c as createStyleSheet } from './JSS-8c381d8b.js';
6
- import { R as REFERRAL_CODES_NAMESPACE, S as SET_CODE_COPIED } from './useReferralCodes-cff9a9dc.js';
7
- import { C as CopyTextView } from './copy-text-view-c508f2e1.js';
8
-
9
- const vanillaStyle = `
10
- :host {
11
- display: block;
12
- width: 100%;
13
- }
14
- `;
15
- function ShareLinkView(props) {
16
- const { copyTextViewProps, customizeUrl, customizeLinkLabel, saveLabelText, cancelLabelText, isEditing, editValue, domainPrefix, editsRemaining, maxEdits, limitReached, validationError, isValidating, isSaving, characterLimit, minCharacters, charactersRemaining, editLimitText, editLimitReachedText, supportLinkText, customizeDisabled, customizeDisabledTooltip, onCustomizeClick, onEditValueChange, onSave, onCancel, } = props;
17
- const style = {
18
- Container: {
19
- display: "flex",
20
- flexDirection: "column",
21
- gap: "var(--sl-spacing-xx-small)",
22
- width: "100%",
23
- },
24
- CustomizeLinkText: {
25
- margin: "0",
26
- fontSize: "var(--sl-font-size-small)",
27
- fontWeight: "600",
28
- cursor: "pointer",
29
- color: "var(--sl-color-neutral-900)",
30
- textAlign: "left",
31
- padding: "var(--sl-spacing-small)",
32
- "&:hover": {
33
- textDecoration: "underline",
34
- },
35
- },
36
- CustomizeLinkDisabled: {
37
- margin: "0",
38
- fontSize: "var(--sl-font-size-small)",
39
- fontWeight: "600",
40
- color: "var(--sl-color-neutral-400)",
41
- cursor: "default",
42
- textAlign: "left",
43
- padding: "var(--sl-spacing-small)",
44
- },
45
- EditContainer: {
46
- display: "flex",
47
- flexDirection: "column",
48
- gap: "var(--sl-spacing-x-small)",
49
- width: "100%",
50
- },
51
- EditInputWrapper: {
52
- display: "flex",
53
- alignItems: "center",
54
- width: "100%",
55
- border: "var(--sqm-border-thickness, 1px) solid var(--sqm-input-border-color, #d1d5db)",
56
- borderRadius: "var(--sqm-border-radius-normal, 4px)",
57
- background: "var(--sqm-input-background, #fff)",
58
- overflow: "hidden",
59
- "&:focus-within": {
60
- borderColor: "#999999",
61
- boxShadow: "0 0 0 var(--sl-focus-ring-width) var(--sl-input-focus-ring-color)",
62
- },
63
- },
64
- DomainPrefix: {
65
- padding: "0 0 0 var(--sl-spacing-medium)",
66
- fontSize: "var(--sl-font-size-medium)",
67
- color: "var(--sl-color-neutral-500)",
68
- whiteSpace: "nowrap",
69
- userSelect: "none",
70
- lineHeight: "var(--sl-input-height-medium)",
71
- },
72
- EditInput: {
73
- flex: "1",
74
- border: "none",
75
- outline: "none",
76
- padding: "0 var(--sl-spacing-medium) 0 0",
77
- fontSize: "var(--sl-font-size-medium)",
78
- fontFamily: "var(--sl-font-sans)",
79
- color: "var(--sl-input-color)",
80
- background: "transparent",
81
- lineHeight: "var(--sl-input-height-medium)",
82
- minWidth: "0",
83
- },
84
- EditLabel: {
85
- margin: "0",
86
- fontSize: "var(--sl-font-size-small)",
87
- color: "var(--sl-color-neutral-500)",
88
- },
89
- HelperText: {
90
- margin: "0",
91
- fontSize: "var(--sl-font-size-small)",
92
- color: "var(--sl-color-neutral-500)",
93
- },
94
- ErrorText: {
95
- margin: "0",
96
- fontSize: "var(--sl-font-size-small)",
97
- color: "var(--sqm-danger-color-text, #dc2626)",
98
- },
99
- ActionRow: {
100
- display: "flex",
101
- gap: "var(--sl-spacing-medium)",
102
- alignItems: "center",
103
- },
104
- SaveButton: {
105
- cursor: "pointer",
106
- fontFamily: "var(--sl-font-sans)",
107
- fontSize: "var(--sl-font-size-small)",
108
- fontWeight: "600",
109
- padding: "var(--sl-spacing-x-small) var(--sl-spacing-medium)",
110
- borderRadius: "var(--sqm-border-radius-normal, 4px)",
111
- border: "1px solid var(--sl-color-neutral-900)",
112
- background: "var(--sl-color-neutral-900)",
113
- color: "#fff",
114
- "&:disabled": {
115
- opacity: "0.5",
116
- cursor: "default",
117
- },
118
- },
119
- CancelButton: {
120
- margin: "0",
121
- fontSize: "var(--sl-font-size-small)",
122
- fontWeight: "600",
123
- cursor: "pointer",
124
- background: "none",
125
- border: "none",
126
- padding: "0",
127
- fontFamily: "var(--sl-font-sans)",
128
- color: "var(--sl-color-neutral-500)",
129
- },
130
- LimitReachedContainer: {
131
- display: "flex",
132
- alignItems: "center",
133
- gap: "var(--sl-spacing-x-small)",
134
- },
135
- };
136
- const sheet = createStyleSheet(style);
137
- const styleString = sheet.toString();
138
- const errorMessageType = (validationError === null || validationError === void 0 ? void 0 : validationError.code) === "EXISTING_CODE_CONFLICT" ? "info" : "warning";
139
- const showCharactersRemaining = charactersRemaining <= 14;
140
- console.log(customizeUrl, limitReached, customizeDisabled, validationError, "customize URL state");
141
- // Editing state
142
- if (isEditing) {
143
- return (h("div", { class: sheet.classes.Container },
144
- h("style", { type: "text/css" },
145
- styleString,
146
- vanillaStyle),
147
- h("p", { class: sheet.classes.EditLabel }, "Enter your link"),
148
- h("div", { class: sheet.classes.EditInputWrapper },
149
- h("span", { class: sheet.classes.DomainPrefix }, domainPrefix),
150
- h("sl-input", { class: sheet.classes.EditInput, type: "text", value: editValue, onInput: (e) => onEditValueChange(e.target.value), onKeyDown: (e) => {
151
- if (e.key === "/" || e.key === "@")
152
- e.preventDefault();
153
- }, disabled: isSaving, maxLength: characterLimit })),
154
- h("p", { class: sheet.classes.HelperText },
155
- editLimitText,
156
- showCharactersRemaining &&
157
- ` Characters remaining: ${charactersRemaining}`),
158
- validationError && (h("sqm-form-message", { type: errorMessageType, style: { paddingBottom: "var(--sl-spacing-xx-small)" } },
159
- h("p", { part: "alert-title" }, validationError.title),
160
- validationError.description)),
161
- isValidating && h("p", { class: sheet.classes.HelperText }, "Validating..."),
162
- h("div", { class: sheet.classes.ActionRow },
163
- h("sl-button", { type: "primary", onClick: onSave, disabled: isSaving ||
164
- isValidating ||
165
- !!validationError ||
166
- !editValue ||
167
- editValue.length < minCharacters }, isSaving ? "Saving..." : saveLabelText),
168
- h("sl-button", { type: "secondary", class: sheet.classes.CancelButton, onClick: onCancel, disabled: isSaving }, cancelLabelText))));
169
- }
170
- // Default / Customized / Limit reached states
171
- return (h("div", { class: sheet.classes.Container },
172
- h("style", { type: "text/css" },
173
- styleString,
174
- vanillaStyle),
175
- h(CopyTextView, Object.assign({}, copyTextViewProps)),
176
- customizeUrl &&
177
- (customizeDisabled ? (h("sl-tooltip", { content: customizeDisabledTooltip, placement: "top", style: { display: "inline-block", width: "fit-content" } },
178
- h("p", { class: sheet.classes.CustomizeLinkDisabled }, customizeLinkLabel))) : (h("div", { class: sheet.classes.LimitReachedContainer },
179
- h("p", { class: limitReached
180
- ? sheet.classes.CustomizeLinkDisabled
181
- : sheet.classes.CustomizeLinkText, onClick: limitReached ? undefined : onCustomizeClick }, customizeLinkLabel),
182
- customizeUrl && limitReached && (h("p", { class: sheet.classes.HelperText }, intl.formatMessage({
183
- id: "editLimitReached",
184
- defaultMessage: editLimitReachedText,
185
- }, {
186
- supportLink: (h("a", { target: "_blank", href: "https://help.impact.com/other/readme/get-help-and-support" }, supportLinkText)),
187
- }))))))));
188
- }
189
-
190
- const MAX_EDITS = 5;
191
- const CHARACTER_LIMIT = 15;
192
- const MIN_CHARACTERS = 3;
193
- const MessageLinkQuery = dist.gql `
194
- query ($programId: ID) {
195
- user: viewer {
196
- ... on User {
197
- shareLink(programId: $programId)
198
- }
199
- }
200
- }
201
- `;
202
- const WIDGET_ENGAGEMENT_EVENT = dist.gql `
203
- mutation loadEvent($eventMeta: UserAnalyticsEvent!) {
204
- createUserAnalyticsEvent(eventMeta: $eventMeta)
205
- }
206
- `;
207
- const ADD_SHARE_LINK_CODE = dist.gql `
208
- mutation ($addShareLinkCodeInput: AddShareLinkCodeInput!) {
209
- addShareLinkCode(addShareLinkCodeInput: $addShareLinkCodeInput) {
210
- linkCode {
211
- linkCode
212
- shortUrl
213
- referralCode {
214
- code
215
- }
216
- }
217
- }
218
- }
219
- `;
220
- const VALIDATE_LINK_CODE = dist.gql `
221
- query validateLinkCode($linkCode: String!) {
222
- validateLinkCode(linkCode: $linkCode) {
223
- valid
224
- invalidReason
225
- }
226
- }
227
- `;
228
- const GET_LINK_DOMAIN = dist.gql `
229
- query getLinkDomain {
230
- tenantSettings {
231
- primaryLinkDomain {
232
- host
233
- }
234
- }
235
- }
236
- `;
237
- const SHARE_LINK_EDIT_COUNT = dist.gql `
238
- query shareLinkEditCount {
239
- viewer {
240
- ... on User {
241
- shareLinkCodes {
242
- totalCount
243
- data {
244
- isVanity
245
- }
246
- }
247
- }
248
- }
249
- }
250
- `;
251
- function parseShareUrl(url) {
252
- try {
253
- const parsed = new URL(url);
254
- return {
255
- url: parsed.origin + parsed.pathname,
256
- domain: parsed.origin + "/",
257
- path: parsed.pathname.slice(1),
258
- };
259
- }
260
- catch {
261
- return { url, domain: url, path: "" };
262
- }
263
- }
264
- function useShareLink(props) {
265
- var _a, _b, _c, _d, _e, _f, _g;
266
- const { programId = H() } = props;
267
- const user = J();
268
- const engagementMedium = B();
269
- const contextData = Fn(REFERRAL_CODES_NAMESPACE);
270
- const { data, refetch } = wn(MessageLinkQuery, { programId }, !(user === null || user === void 0 ? void 0 : user.jwt) || !!props.linkOverride || (contextData === null || contextData === void 0 ? void 0 : contextData.shareLink) !== undefined);
271
- const [sendLoadEvent] = $e(WIDGET_ENGAGEMENT_EVENT);
272
- const [setCopied] = $e(SET_CODE_COPIED);
273
- const [addShareLinkCode, { loading: isSaving }] = $e(ADD_SHARE_LINK_CODE);
274
- const [validateLinkCode] = Xe(VALIDATE_LINK_CODE);
275
- const { refresh } = Qe();
276
- const { data: linkDomainData } = wn(GET_LINK_DOMAIN, {}, !(user === null || user === void 0 ? void 0 : user.jwt) || !props.customizeUrl);
277
- const { data: editCountData, refetch: refetchEditCount } = wn(SHARE_LINK_EDIT_COUNT, {}, !(user === null || user === void 0 ? void 0 : user.jwt) || !props.customizeUrl);
278
- 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 :
279
- // Shown during loading
280
- "...");
281
- const [open, setOpen] = useState(false);
282
- const [isEditing, setIsEditing] = useState(false);
283
- const [editValue, setEditValue] = useState("");
284
- const [validationError, setValidationError] = useState(null);
285
- const [isValidating, setIsValidating] = useState(false);
286
- const debounceTimerRef = useRef(undefined);
287
- const hasPrimaryLinkDomain = ((_c = linkDomainData === null || linkDomainData === void 0 ? void 0 : linkDomainData.tenantSettings) === null || _c === void 0 ? void 0 : _c.primaryLinkDomain) != null;
288
- const customizeDisabled = !hasPrimaryLinkDomain;
289
- 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;
290
- const editCount = vanityCount;
291
- const editsRemaining = Math.max(0, MAX_EDITS - editCount);
292
- const limitReached = editsRemaining <= 0;
293
- function mapErrorCodeToInfo(errorCode) {
294
- if (!errorCode)
295
- return null;
296
- const errorMap = {
297
- EXISTING_CODE_CONFLICT: {
298
- code: "EXISTING_CODE_CONFLICT",
299
- title: props.existingCodeConflictErrorTitle,
300
- description: props.existingCodeConflictErrorDescription,
301
- },
302
- INVALID_CHARACTER: {
303
- code: "INVALID_CHARACTER",
304
- title: props.invalidCharactersErrorTitle,
305
- description: props.invalidCharactersErrorDescription,
306
- },
307
- BLOCKED_WORD: {
308
- code: "BLOCKED_WORD",
309
- title: props.profanityErrorTitle,
310
- description: props.profanityErrorDescription,
311
- },
312
- };
313
- return errorMap[errorCode];
314
- }
315
- async function onClick() {
316
- if (contextData) {
317
- await setCopied({ referralCode: contextData.referralCode });
318
- contextData.refresh();
319
- }
320
- // Should well supported: https://developer.mozilla.org/en-US/docs/Web/API/Clipboard#browser_compatibility
321
- // Only if called from a user-initiated event
322
- navigator.clipboard.writeText(copyString);
323
- setOpen(true);
324
- setTimeout(() => setOpen(false), props.tooltiplifespan);
325
- sendLoadEvent({
326
- eventMeta: {
327
- programId,
328
- id: user === null || user === void 0 ? void 0 : user.id,
329
- accountId: user === null || user === void 0 ? void 0 : user.accountId,
330
- type: "USER_REFERRAL_PROGRAM_ENGAGEMENT_EVENT",
331
- meta: {
332
- engagementMedium,
333
- shareMedium: "DIRECT",
334
- },
335
- },
336
- });
337
- }
338
- function onCustomizeClick() {
339
- if (limitReached || customizeDisabled)
340
- return;
341
- setIsEditing(true);
342
- setEditValue(editCount === 0 ? "" : pathSuffix);
343
- setValidationError(null);
344
- }
345
- function onEditValueChange(value) {
346
- const trimmed = value.slice(0, CHARACTER_LIMIT);
347
- setEditValue(trimmed);
348
- setValidationError(null);
349
- if (debounceTimerRef.current)
350
- clearTimeout(debounceTimerRef.current);
351
- if (!trimmed || trimmed.length < MIN_CHARACTERS) {
352
- setIsValidating(false);
353
- return;
354
- }
355
- setIsValidating(true);
356
- debounceTimerRef.current = setTimeout(async () => {
357
- var _a, _b;
358
- try {
359
- const result = await validateLinkCode({ linkCode: trimmed });
360
- if (!((_a = result === null || result === void 0 ? void 0 : result.validateLinkCode) === null || _a === void 0 ? void 0 : _a.valid)) {
361
- const reason = (_b = result === null || result === void 0 ? void 0 : result.validateLinkCode) === null || _b === void 0 ? void 0 : _b.invalidReason;
362
- console.log(reason, "validation error reason from validateLinkCode query");
363
- setValidationError(mapErrorCodeToInfo(reason));
364
- }
365
- }
366
- catch {
367
- // Validation query failed — don't block the user
368
- }
369
- setIsValidating(false);
370
- }, 2000);
371
- }
372
- async function onSave() {
373
- var _a, _b;
374
- if (!editValue ||
375
- editValue.length < MIN_CHARACTERS ||
376
- validationError ||
377
- isValidating)
378
- return;
379
- try {
380
- await addShareLinkCode({
381
- addShareLinkCodeInput: {
382
- userId: user === null || user === void 0 ? void 0 : user.id,
383
- accountId: user === null || user === void 0 ? void 0 : user.accountId,
384
- programId,
385
- linkCode: editValue,
386
- makeShareLinkCodePrimaryForReferralCode: true,
387
- },
388
- });
389
- setIsEditing(false);
390
- await Promise.all([refetch(), refetchEditCount()]);
391
- refresh();
392
- }
393
- catch (e) {
394
- const errorCode = (_a = e === null || e === void 0 ? void 0 : e.extensions) === null || _a === void 0 ? void 0 : _a.code;
395
- console.log(errorCode, "errorCode from addSharelInkCodeMutation");
396
- setValidationError((_b = mapErrorCodeToInfo(errorCode)) !== null && _b !== void 0 ? _b : {
397
- code: null,
398
- title: "Error",
399
- description: (e === null || e === void 0 ? void 0 : e.message) || "Failed to save custom link. Please try again.",
400
- });
401
- }
402
- }
403
- function onCancel() {
404
- setIsEditing(false);
405
- setEditValue("");
406
- setValidationError(null);
407
- setIsValidating(false);
408
- }
409
- console.log(validationError, "validation error state"); // TEMP --- IGNORE ---
410
- return {
411
- copyTextViewProps: {
412
- ...props,
413
- onClick,
414
- open,
415
- copyString,
416
- },
417
- customizeUrl: props.customizeUrl,
418
- customizeLinkLabel: props.customizeLinkLabel,
419
- saveLabelText: props.saveLabelText,
420
- cancelLabelText: props.cancelLabelText,
421
- isEditing,
422
- editValue,
423
- domainPrefix,
424
- editsRemaining,
425
- maxEdits: MAX_EDITS,
426
- limitReached,
427
- validationError,
428
- isValidating,
429
- isSaving,
430
- characterLimit: CHARACTER_LIMIT,
431
- minCharacters: MIN_CHARACTERS,
432
- charactersRemaining: CHARACTER_LIMIT - editValue.length,
433
- editLimitText: props.editLimitText,
434
- editLimitReachedText: props.editLimitReachedText,
435
- supportLinkText: props.supportLinkText,
436
- customizeDisabled,
437
- customizeDisabledTooltip: props.customizeDisabledTooltip,
438
- onCustomizeClick,
439
- onEditValueChange,
440
- onSave,
441
- onCancel,
442
- };
443
- }
444
-
445
- export { ShareLinkView as S, useShareLink as u };