@saasquatch/mint-components 2.1.9 → 2.1.10-1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/{ShadowViewAddon-1798acd3.js → ShadowViewAddon-c97e80de.js} +39 -22
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/mint-components.cjs.js +1 -1
- package/dist/cjs/sqm-big-stat_45.cjs.entry.js +62 -2
- package/dist/cjs/sqm-empty_4.cjs.entry.js +1 -1
- package/dist/cjs/{sqm-portal-container-view-70a47420.js → sqm-portal-container-view-757f921b.js} +5 -6
- package/dist/cjs/sqm-stencilbook.cjs.entry.js +6 -2
- package/dist/collection/components/sqm-portal-container/sqm-portal-container-view.js +6 -7
- package/dist/collection/components/sqm-share-link/ShareLink.stories.js +4 -0
- package/dist/collection/components/sqm-share-link/sqm-share-link-view.js +16 -16
- package/dist/collection/components/sqm-share-link/sqm-share-link.js +247 -18
- package/dist/collection/components/sqm-share-link/useShareLink.js +22 -5
- package/dist/esm/{ShadowViewAddon-44c263e0.js → ShadowViewAddon-33f1a8f7.js} +39 -22
- package/dist/esm/loader.js +1 -1
- package/dist/esm/mint-components.js +1 -1
- package/dist/esm/sqm-big-stat_45.entry.js +62 -2
- package/dist/esm/sqm-empty_4.entry.js +1 -1
- package/dist/esm/{sqm-portal-container-view-a8c708cd.js → sqm-portal-container-view-200c9df8.js} +6 -7
- package/dist/esm/sqm-stencilbook.entry.js +6 -2
- package/dist/esm-es5/{ShadowViewAddon-44c263e0.js → ShadowViewAddon-33f1a8f7.js} +1 -1
- package/dist/esm-es5/loader.js +1 -1
- package/dist/esm-es5/mint-components.js +1 -1
- package/dist/esm-es5/sqm-big-stat_45.entry.js +1 -1
- package/dist/esm-es5/sqm-empty_4.entry.js +1 -1
- package/dist/esm-es5/sqm-portal-container-view-200c9df8.js +1 -0
- package/dist/esm-es5/sqm-stencilbook.entry.js +1 -1
- package/dist/mint-components/mint-components.esm.js +1 -1
- package/dist/mint-components/{p-eab25269.js → p-08930b83.js} +4 -4
- package/dist/mint-components/p-0b1e90fe.system.js +1 -0
- package/dist/mint-components/{p-b04289d6.entry.js → p-76271ec4.entry.js} +2 -2
- package/dist/mint-components/{p-df073770.system.js → p-78b40f71.system.js} +1 -1
- package/dist/mint-components/{p-d2e8359a.entry.js → p-8784539d.entry.js} +10 -10
- package/dist/mint-components/{p-058aefe1.entry.js → p-af407cce.entry.js} +1 -1
- package/dist/mint-components/{p-a171767a.system.entry.js → p-c3c8d4ee.system.entry.js} +1 -1
- package/dist/mint-components/p-ca098be1.system.js +1 -1
- package/dist/mint-components/{p-4900c740.system.entry.js → p-dd12c32a.system.entry.js} +1 -1
- package/dist/mint-components/p-e30abc44.js +1 -0
- package/dist/mint-components/{p-aefc6c4f.system.entry.js → p-e9485160.system.entry.js} +1 -1
- package/dist/types/components/sqm-share-link/sqm-share-link-view.d.ts +4 -0
- package/dist/types/components/sqm-share-link/sqm-share-link.d.ts +56 -1
- package/dist/types/components/sqm-share-link/useShareLink.d.ts +6 -0
- package/dist/types/components.d.ts +100 -2
- package/docs/docs.docx +0 -0
- package/docs/raisins.json +1 -1
- package/docs/stats.json +122783 -0
- package/grapesjs/grapesjs.js +1 -1
- package/package.json +2 -2
- package/dist/esm-es5/sqm-portal-container-view-a8c708cd.js +0 -1
- package/dist/mint-components/p-b699f76e.system.js +0 -1
- package/dist/mint-components/p-b6a1e2ac.js +0 -1
- package/dist/types/global/android.d.ts +0 -7
- package/dist/types/global/demo.d.ts +0 -2
- package/dist/types/stories/features.d.ts +0 -4
- package/dist/types/stories/templates.d.ts +0 -4
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { h
|
|
1
|
+
import { h } from "@stencil/core";
|
|
2
2
|
import { createStyleSheet } from "../../styling/JSS";
|
|
3
3
|
export function PortalContainerView(props, children) {
|
|
4
4
|
const style = {
|
|
@@ -24,10 +24,9 @@ export function PortalContainerView(props, children) {
|
|
|
24
24
|
}`;
|
|
25
25
|
const sheet = createStyleSheet(style);
|
|
26
26
|
const styleString = sheet.toString();
|
|
27
|
-
return (h(
|
|
28
|
-
h("
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
children)));
|
|
27
|
+
return (h("div", { class: sheet.classes.Container, part: "sqm-base" },
|
|
28
|
+
h("style", { type: "text/css" },
|
|
29
|
+
vanillaStyle,
|
|
30
|
+
styleString),
|
|
31
|
+
children));
|
|
33
32
|
}
|
|
@@ -105,7 +105,11 @@ const defaultCustomizeProps = {
|
|
|
105
105
|
allowCustomization: true,
|
|
106
106
|
customizeLinkLabel: "Customize Link",
|
|
107
107
|
saveLabelText: "Save",
|
|
108
|
+
savingLabelText: "Saving...",
|
|
108
109
|
cancelLabelText: "Cancel",
|
|
110
|
+
editLabelText: "Edit your link",
|
|
111
|
+
charactersRemainingText: "{count} characters remaining",
|
|
112
|
+
validatingLabelText: "Validating...",
|
|
109
113
|
isEditing: false,
|
|
110
114
|
editValue: "",
|
|
111
115
|
domainPrefix: "https://ssqt.co/",
|
|
@@ -9,7 +9,7 @@ const vanillaStyle = `
|
|
|
9
9
|
}
|
|
10
10
|
`;
|
|
11
11
|
export function ShareLinkView(props) {
|
|
12
|
-
const { copyTextViewProps, allowCustomization, customizeLinkLabel, saveLabelText, cancelLabelText, isEditing, editValue, domainPrefix, editsRemaining,
|
|
12
|
+
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;
|
|
13
13
|
const style = {
|
|
14
14
|
Container: {
|
|
15
15
|
display: "flex",
|
|
@@ -66,16 +66,13 @@ export function ShareLinkView(props) {
|
|
|
66
66
|
lineHeight: "var(--sl-input-height-medium)",
|
|
67
67
|
},
|
|
68
68
|
EditInput: {
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
background: "transparent",
|
|
77
|
-
lineHeight: "var(--sl-input-height-medium)",
|
|
78
|
-
minWidth: "0",
|
|
69
|
+
"&::part(base)": {
|
|
70
|
+
border: "none",
|
|
71
|
+
borderRadius: "0",
|
|
72
|
+
},
|
|
73
|
+
"&::part(input)": {
|
|
74
|
+
margin: 0,
|
|
75
|
+
},
|
|
79
76
|
},
|
|
80
77
|
EditLabel: {
|
|
81
78
|
margin: "0",
|
|
@@ -146,10 +143,10 @@ export function ShareLinkView(props) {
|
|
|
146
143
|
h("style", { type: "text/css" },
|
|
147
144
|
styleString,
|
|
148
145
|
vanillaStyle),
|
|
149
|
-
h("p", { class: sheet.classes.EditLabel },
|
|
146
|
+
h("p", { class: sheet.classes.EditLabel }, editLabelText),
|
|
150
147
|
h("div", { class: sheet.classes.EditInputWrapper },
|
|
151
148
|
h("span", { class: sheet.classes.DomainPrefix }, domainPrefix),
|
|
152
|
-
h("input", { class: sheet.classes.EditInput, type: "text", value: editValue, onInput: (e) => onEditValueChange(e.target.value), onKeyDown: (e) => {
|
|
149
|
+
h("sl-input", { class: sheet.classes.EditInput, type: "text", value: editValue, onInput: (e) => onEditValueChange(e.target.value), onKeyDown: (e) => {
|
|
153
150
|
if (e.key === "/" || e.key === "@")
|
|
154
151
|
e.preventDefault();
|
|
155
152
|
}, disabled: isSaving, maxLength: characterLimit })),
|
|
@@ -158,17 +155,20 @@ export function ShareLinkView(props) {
|
|
|
158
155
|
" ",
|
|
159
156
|
charactersRemaining > 12 && minCharactersText,
|
|
160
157
|
showCharactersRemaining &&
|
|
161
|
-
`
|
|
158
|
+
` ${intl.formatMessage({
|
|
159
|
+
id: "charactersRemainingText",
|
|
160
|
+
defaultMessage: charactersRemainingText,
|
|
161
|
+
}, { charactersRemaining })}`),
|
|
162
162
|
validationError && (h("sqm-form-message", { type: errorMessageType, style: { paddingBottom: "var(--sl-spacing-xx-small)" } },
|
|
163
163
|
h("p", { part: "alert-title" }, validationError.title),
|
|
164
164
|
validationError.description)),
|
|
165
|
-
isValidating && h("p", { class: sheet.classes.HelperText },
|
|
165
|
+
isValidating && (h("p", { class: sheet.classes.HelperText }, validatingLabelText)),
|
|
166
166
|
h("div", { class: sheet.classes.ActionRow },
|
|
167
167
|
h("button", { class: sheet.classes.SaveButton, onClick: onSave, disabled: isSaving ||
|
|
168
168
|
isValidating ||
|
|
169
169
|
!!validationError ||
|
|
170
170
|
!editValue ||
|
|
171
|
-
editValue.length < minCharacters }, isSaving ?
|
|
171
|
+
editValue.length < minCharacters }, isSaving ? savingLabelText : saveLabelText),
|
|
172
172
|
h("sl-button", { type: "text", class: sheet.classes.CancelButton, onClick: onCancel, disabled: isSaving }, cancelLabelText))));
|
|
173
173
|
}
|
|
174
174
|
// Default / Customized / Limit reached states
|
|
@@ -64,6 +64,7 @@ export class ShareLink {
|
|
|
64
64
|
* @uiName Allow customization
|
|
65
65
|
* @uiType boolean
|
|
66
66
|
* @uiGroup Customizable Vanity Link
|
|
67
|
+
* @uiWidget CustomLinkSwitch
|
|
67
68
|
* @requiredFlavor impact
|
|
68
69
|
*/
|
|
69
70
|
this.allowCustomization = false;
|
|
@@ -179,6 +180,42 @@ export class ShareLink {
|
|
|
179
180
|
* @requiredFlavor impact
|
|
180
181
|
*/
|
|
181
182
|
this.saveLabelText = "Save";
|
|
183
|
+
/**
|
|
184
|
+
* Text for the save button while saving is in progress
|
|
185
|
+
*
|
|
186
|
+
* @uiName Saving button label
|
|
187
|
+
* @uiType string
|
|
188
|
+
* @uiGroup Customizable Vanity Link
|
|
189
|
+
* @requiredFlavor impact
|
|
190
|
+
*/
|
|
191
|
+
this.savingLabelText = "Saving...";
|
|
192
|
+
/**
|
|
193
|
+
* Label shown above the link input while editing
|
|
194
|
+
*
|
|
195
|
+
* @uiName Edit input label
|
|
196
|
+
* @uiType string
|
|
197
|
+
* @uiGroup Customizable Vanity Link
|
|
198
|
+
* @requiredFlavor impact
|
|
199
|
+
*/
|
|
200
|
+
this.editLabelText = "Enter your link";
|
|
201
|
+
/**
|
|
202
|
+
* Text shown when nearing the character limit. Use {charactersRemaining} as a placeholder for the count.
|
|
203
|
+
*
|
|
204
|
+
* @uiName Characters remaining text
|
|
205
|
+
* @uiType string
|
|
206
|
+
* @uiGroup Customizable Vanity Link
|
|
207
|
+
* @requiredFlavor impact
|
|
208
|
+
*/
|
|
209
|
+
this.charactersRemainingText = "Characters remaining: {charactersRemaining}";
|
|
210
|
+
/**
|
|
211
|
+
* Text shown while the link is being validated
|
|
212
|
+
*
|
|
213
|
+
* @uiName Validating label
|
|
214
|
+
* @uiType string
|
|
215
|
+
* @uiGroup Customizable Vanity Link
|
|
216
|
+
* @requiredFlavor impact
|
|
217
|
+
*/
|
|
218
|
+
this.validatingLabelText = "Validating...";
|
|
182
219
|
/**
|
|
183
220
|
* @uiName Min characters text
|
|
184
221
|
* @uiType string
|
|
@@ -195,6 +232,25 @@ export class ShareLink {
|
|
|
195
232
|
* @requiredFlavor impact
|
|
196
233
|
*/
|
|
197
234
|
this.supportLinkText = "Support";
|
|
235
|
+
/**
|
|
236
|
+
* Title shown when saving fails with an unknown error
|
|
237
|
+
*
|
|
238
|
+
* @uiName Save error title
|
|
239
|
+
* @uiType string
|
|
240
|
+
* @uiGroup Customizable Vanity Link
|
|
241
|
+
* @requiredFlavor impact
|
|
242
|
+
*/
|
|
243
|
+
this.saveErrorTitle = "Error";
|
|
244
|
+
/**
|
|
245
|
+
* Description shown when saving fails with an unknown error
|
|
246
|
+
*
|
|
247
|
+
* @uiName Save error description
|
|
248
|
+
* @uiType string
|
|
249
|
+
* @uiWidget textarea
|
|
250
|
+
* @uiGroup Customizable Vanity Link
|
|
251
|
+
* @requiredFlavor impact
|
|
252
|
+
*/
|
|
253
|
+
this.saveErrorDescription = "Failed to save custom link. Please try again.";
|
|
198
254
|
withHooks(this);
|
|
199
255
|
}
|
|
200
256
|
disconnectedCallback() { }
|
|
@@ -526,6 +582,9 @@ export class ShareLink {
|
|
|
526
582
|
}, {
|
|
527
583
|
"text": "Customizable Vanity Link",
|
|
528
584
|
"name": "uiGroup"
|
|
585
|
+
}, {
|
|
586
|
+
"text": "CustomLinkSwitch",
|
|
587
|
+
"name": "uiWidget"
|
|
529
588
|
}, {
|
|
530
589
|
"text": "impact",
|
|
531
590
|
"name": "requiredFlavor"
|
|
@@ -908,6 +967,126 @@ export class ShareLink {
|
|
|
908
967
|
"reflect": false,
|
|
909
968
|
"defaultValue": "\"Save\""
|
|
910
969
|
},
|
|
970
|
+
"savingLabelText": {
|
|
971
|
+
"type": "string",
|
|
972
|
+
"mutable": false,
|
|
973
|
+
"complexType": {
|
|
974
|
+
"original": "string",
|
|
975
|
+
"resolved": "string",
|
|
976
|
+
"references": {}
|
|
977
|
+
},
|
|
978
|
+
"required": false,
|
|
979
|
+
"optional": true,
|
|
980
|
+
"docs": {
|
|
981
|
+
"tags": [{
|
|
982
|
+
"text": "Saving button label",
|
|
983
|
+
"name": "uiName"
|
|
984
|
+
}, {
|
|
985
|
+
"text": "string",
|
|
986
|
+
"name": "uiType"
|
|
987
|
+
}, {
|
|
988
|
+
"text": "Customizable Vanity Link",
|
|
989
|
+
"name": "uiGroup"
|
|
990
|
+
}, {
|
|
991
|
+
"text": "impact",
|
|
992
|
+
"name": "requiredFlavor"
|
|
993
|
+
}],
|
|
994
|
+
"text": "Text for the save button while saving is in progress"
|
|
995
|
+
},
|
|
996
|
+
"attribute": "saving-label-text",
|
|
997
|
+
"reflect": false,
|
|
998
|
+
"defaultValue": "\"Saving...\""
|
|
999
|
+
},
|
|
1000
|
+
"editLabelText": {
|
|
1001
|
+
"type": "string",
|
|
1002
|
+
"mutable": false,
|
|
1003
|
+
"complexType": {
|
|
1004
|
+
"original": "string",
|
|
1005
|
+
"resolved": "string",
|
|
1006
|
+
"references": {}
|
|
1007
|
+
},
|
|
1008
|
+
"required": false,
|
|
1009
|
+
"optional": true,
|
|
1010
|
+
"docs": {
|
|
1011
|
+
"tags": [{
|
|
1012
|
+
"text": "Edit input label",
|
|
1013
|
+
"name": "uiName"
|
|
1014
|
+
}, {
|
|
1015
|
+
"text": "string",
|
|
1016
|
+
"name": "uiType"
|
|
1017
|
+
}, {
|
|
1018
|
+
"text": "Customizable Vanity Link",
|
|
1019
|
+
"name": "uiGroup"
|
|
1020
|
+
}, {
|
|
1021
|
+
"text": "impact",
|
|
1022
|
+
"name": "requiredFlavor"
|
|
1023
|
+
}],
|
|
1024
|
+
"text": "Label shown above the link input while editing"
|
|
1025
|
+
},
|
|
1026
|
+
"attribute": "edit-label-text",
|
|
1027
|
+
"reflect": false,
|
|
1028
|
+
"defaultValue": "\"Enter your link\""
|
|
1029
|
+
},
|
|
1030
|
+
"charactersRemainingText": {
|
|
1031
|
+
"type": "string",
|
|
1032
|
+
"mutable": false,
|
|
1033
|
+
"complexType": {
|
|
1034
|
+
"original": "string",
|
|
1035
|
+
"resolved": "string",
|
|
1036
|
+
"references": {}
|
|
1037
|
+
},
|
|
1038
|
+
"required": false,
|
|
1039
|
+
"optional": true,
|
|
1040
|
+
"docs": {
|
|
1041
|
+
"tags": [{
|
|
1042
|
+
"text": "Characters remaining text",
|
|
1043
|
+
"name": "uiName"
|
|
1044
|
+
}, {
|
|
1045
|
+
"text": "string",
|
|
1046
|
+
"name": "uiType"
|
|
1047
|
+
}, {
|
|
1048
|
+
"text": "Customizable Vanity Link",
|
|
1049
|
+
"name": "uiGroup"
|
|
1050
|
+
}, {
|
|
1051
|
+
"text": "impact",
|
|
1052
|
+
"name": "requiredFlavor"
|
|
1053
|
+
}],
|
|
1054
|
+
"text": "Text shown when nearing the character limit. Use {charactersRemaining} as a placeholder for the count."
|
|
1055
|
+
},
|
|
1056
|
+
"attribute": "characters-remaining-text",
|
|
1057
|
+
"reflect": false,
|
|
1058
|
+
"defaultValue": "\"Characters remaining: {charactersRemaining}\""
|
|
1059
|
+
},
|
|
1060
|
+
"validatingLabelText": {
|
|
1061
|
+
"type": "string",
|
|
1062
|
+
"mutable": false,
|
|
1063
|
+
"complexType": {
|
|
1064
|
+
"original": "string",
|
|
1065
|
+
"resolved": "string",
|
|
1066
|
+
"references": {}
|
|
1067
|
+
},
|
|
1068
|
+
"required": false,
|
|
1069
|
+
"optional": true,
|
|
1070
|
+
"docs": {
|
|
1071
|
+
"tags": [{
|
|
1072
|
+
"text": "Validating label",
|
|
1073
|
+
"name": "uiName"
|
|
1074
|
+
}, {
|
|
1075
|
+
"text": "string",
|
|
1076
|
+
"name": "uiType"
|
|
1077
|
+
}, {
|
|
1078
|
+
"text": "Customizable Vanity Link",
|
|
1079
|
+
"name": "uiGroup"
|
|
1080
|
+
}, {
|
|
1081
|
+
"text": "impact",
|
|
1082
|
+
"name": "requiredFlavor"
|
|
1083
|
+
}],
|
|
1084
|
+
"text": "Text shown while the link is being validated"
|
|
1085
|
+
},
|
|
1086
|
+
"attribute": "validating-label-text",
|
|
1087
|
+
"reflect": false,
|
|
1088
|
+
"defaultValue": "\"Validating...\""
|
|
1089
|
+
},
|
|
911
1090
|
"minCharactersText": {
|
|
912
1091
|
"type": "string",
|
|
913
1092
|
"mutable": false,
|
|
@@ -968,12 +1147,75 @@ export class ShareLink {
|
|
|
968
1147
|
"reflect": false,
|
|
969
1148
|
"defaultValue": "\"Support\""
|
|
970
1149
|
},
|
|
1150
|
+
"saveErrorTitle": {
|
|
1151
|
+
"type": "string",
|
|
1152
|
+
"mutable": false,
|
|
1153
|
+
"complexType": {
|
|
1154
|
+
"original": "string",
|
|
1155
|
+
"resolved": "string",
|
|
1156
|
+
"references": {}
|
|
1157
|
+
},
|
|
1158
|
+
"required": false,
|
|
1159
|
+
"optional": true,
|
|
1160
|
+
"docs": {
|
|
1161
|
+
"tags": [{
|
|
1162
|
+
"text": "Save error title",
|
|
1163
|
+
"name": "uiName"
|
|
1164
|
+
}, {
|
|
1165
|
+
"text": "string",
|
|
1166
|
+
"name": "uiType"
|
|
1167
|
+
}, {
|
|
1168
|
+
"text": "Customizable Vanity Link",
|
|
1169
|
+
"name": "uiGroup"
|
|
1170
|
+
}, {
|
|
1171
|
+
"text": "impact",
|
|
1172
|
+
"name": "requiredFlavor"
|
|
1173
|
+
}],
|
|
1174
|
+
"text": "Title shown when saving fails with an unknown error"
|
|
1175
|
+
},
|
|
1176
|
+
"attribute": "save-error-title",
|
|
1177
|
+
"reflect": false,
|
|
1178
|
+
"defaultValue": "\"Error\""
|
|
1179
|
+
},
|
|
1180
|
+
"saveErrorDescription": {
|
|
1181
|
+
"type": "string",
|
|
1182
|
+
"mutable": false,
|
|
1183
|
+
"complexType": {
|
|
1184
|
+
"original": "string",
|
|
1185
|
+
"resolved": "string",
|
|
1186
|
+
"references": {}
|
|
1187
|
+
},
|
|
1188
|
+
"required": false,
|
|
1189
|
+
"optional": true,
|
|
1190
|
+
"docs": {
|
|
1191
|
+
"tags": [{
|
|
1192
|
+
"text": "Save error description",
|
|
1193
|
+
"name": "uiName"
|
|
1194
|
+
}, {
|
|
1195
|
+
"text": "string",
|
|
1196
|
+
"name": "uiType"
|
|
1197
|
+
}, {
|
|
1198
|
+
"text": "textarea",
|
|
1199
|
+
"name": "uiWidget"
|
|
1200
|
+
}, {
|
|
1201
|
+
"text": "Customizable Vanity Link",
|
|
1202
|
+
"name": "uiGroup"
|
|
1203
|
+
}, {
|
|
1204
|
+
"text": "impact",
|
|
1205
|
+
"name": "requiredFlavor"
|
|
1206
|
+
}],
|
|
1207
|
+
"text": "Description shown when saving fails with an unknown error"
|
|
1208
|
+
},
|
|
1209
|
+
"attribute": "save-error-description",
|
|
1210
|
+
"reflect": false,
|
|
1211
|
+
"defaultValue": "\"Failed to save custom link. Please try again.\""
|
|
1212
|
+
},
|
|
971
1213
|
"demoData": {
|
|
972
1214
|
"type": "unknown",
|
|
973
1215
|
"mutable": false,
|
|
974
1216
|
"complexType": {
|
|
975
1217
|
"original": "DemoData<ShareLinkViewProps>",
|
|
976
|
-
"resolved": "{ copyTextViewProps?: CopyTextViewProps; allowCustomization?: boolean; customizeLinkLabel?: string; saveLabelText?: string; cancelLabelText?: string; isEditing?: boolean; editValue?: string; domainPrefix?: string; editsRemaining?: number; maxEdits?: number; limitReached?: boolean; validationError?: ValidationErrorInfo; isValidating?: boolean; isSaving?: boolean; characterLimit?: number; minCharacters?: number; charactersRemaining?: number; editLimitText?: string; editLimitReachedText?: string; minCharactersText?: string; supportLinkText?: string; customizeDisabled?: boolean; customizeDisabledTooltip?: string; onCustomizeClick?: () => void; onEditValueChange?: (value: string) => void; onSave?: () => void; onCancel?: () => void; }",
|
|
1218
|
+
"resolved": "{ copyTextViewProps?: CopyTextViewProps; allowCustomization?: boolean; customizeLinkLabel?: string; saveLabelText?: string; savingLabelText?: string; cancelLabelText?: string; editLabelText?: string; charactersRemainingText?: string; validatingLabelText?: string; isEditing?: boolean; editValue?: string; domainPrefix?: string; editsRemaining?: number; maxEdits?: number; limitReached?: boolean; validationError?: ValidationErrorInfo; isValidating?: boolean; isSaving?: boolean; characterLimit?: number; minCharacters?: number; charactersRemaining?: number; editLimitText?: string; editLimitReachedText?: string; minCharactersText?: string; supportLinkText?: string; customizeDisabled?: boolean; customizeDisabledTooltip?: string; onCustomizeClick?: () => void; onEditValueChange?: (value: string) => void; onSave?: () => void; onCancel?: () => void; }",
|
|
977
1219
|
"references": {
|
|
978
1220
|
"DemoData": {
|
|
979
1221
|
"location": "import",
|
|
@@ -997,23 +1239,6 @@ export class ShareLink {
|
|
|
997
1239
|
}],
|
|
998
1240
|
"text": ""
|
|
999
1241
|
}
|
|
1000
|
-
},
|
|
1001
|
-
"editsRemaining": {
|
|
1002
|
-
"type": "number",
|
|
1003
|
-
"mutable": false,
|
|
1004
|
-
"complexType": {
|
|
1005
|
-
"original": "number",
|
|
1006
|
-
"resolved": "number",
|
|
1007
|
-
"references": {}
|
|
1008
|
-
},
|
|
1009
|
-
"required": false,
|
|
1010
|
-
"optional": true,
|
|
1011
|
-
"docs": {
|
|
1012
|
-
"tags": [],
|
|
1013
|
-
"text": ""
|
|
1014
|
-
},
|
|
1015
|
-
"attribute": "edits-remaining",
|
|
1016
|
-
"reflect": false
|
|
1017
1242
|
}
|
|
1018
1243
|
}; }
|
|
1019
1244
|
}
|
|
@@ -1046,7 +1271,11 @@ function useDemoShareLink(props) {
|
|
|
1046
1271
|
allowCustomization: props.allowCustomization,
|
|
1047
1272
|
customizeLinkLabel: props.customizeLinkButtonLabel,
|
|
1048
1273
|
saveLabelText: props.saveLabelText,
|
|
1274
|
+
savingLabelText: props.savingLabelText,
|
|
1049
1275
|
cancelLabelText: props.cancelLabelText,
|
|
1276
|
+
editLabelText: props.editLabelText,
|
|
1277
|
+
charactersRemainingText: props.charactersRemainingText,
|
|
1278
|
+
validatingLabelText: props.validatingLabelText,
|
|
1050
1279
|
isEditing,
|
|
1051
1280
|
editValue,
|
|
1052
1281
|
domainPrefix,
|
|
@@ -99,6 +99,7 @@ export function useShareLink(props) {
|
|
|
99
99
|
const [validationError, setValidationError] = useState(null);
|
|
100
100
|
const [isValidating, setIsValidating] = useState(false);
|
|
101
101
|
const debounceTimerRef = useRef(undefined);
|
|
102
|
+
const latestValidationValueRef = useRef("");
|
|
102
103
|
const hasPrimaryLinkDomain = ((_c = linkDomainData === null || linkDomainData === void 0 ? void 0 : linkDomainData.tenantSettings) === null || _c === void 0 ? void 0 : _c.primaryLinkDomain) != null;
|
|
103
104
|
const customizeDisabled = !hasPrimaryLinkDomain;
|
|
104
105
|
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;
|
|
@@ -161,6 +162,7 @@ export function useShareLink(props) {
|
|
|
161
162
|
const trimmed = value.slice(0, CHARACTER_LIMIT);
|
|
162
163
|
setEditValue(trimmed);
|
|
163
164
|
setValidationError(null);
|
|
165
|
+
latestValidationValueRef.current = trimmed;
|
|
164
166
|
if (debounceTimerRef.current)
|
|
165
167
|
clearTimeout(debounceTimerRef.current);
|
|
166
168
|
if (!trimmed || trimmed.length < MIN_CHARACTERS) {
|
|
@@ -170,8 +172,12 @@ export function useShareLink(props) {
|
|
|
170
172
|
setIsValidating(true);
|
|
171
173
|
debounceTimerRef.current = setTimeout(async () => {
|
|
172
174
|
var _a, _b;
|
|
175
|
+
const requestedValue = trimmed;
|
|
173
176
|
try {
|
|
174
|
-
const result = await validateLinkCode({ linkCode:
|
|
177
|
+
const result = await validateLinkCode({ linkCode: requestedValue });
|
|
178
|
+
// Discard stale responses if the user has continued typing
|
|
179
|
+
if (latestValidationValueRef.current !== requestedValue)
|
|
180
|
+
return;
|
|
175
181
|
if (!((_a = result === null || result === void 0 ? void 0 : result.validateLinkCode) === null || _a === void 0 ? void 0 : _a.valid)) {
|
|
176
182
|
const reason = (_b = result === null || result === void 0 ? void 0 : result.validateLinkCode) === null || _b === void 0 ? void 0 : _b.invalidReason;
|
|
177
183
|
setValidationError(mapErrorCodeToInfo(reason));
|
|
@@ -179,9 +185,13 @@ export function useShareLink(props) {
|
|
|
179
185
|
}
|
|
180
186
|
catch {
|
|
181
187
|
// Validation query failed — don't block the user
|
|
188
|
+
if (latestValidationValueRef.current !== requestedValue)
|
|
189
|
+
return;
|
|
182
190
|
}
|
|
183
|
-
|
|
184
|
-
|
|
191
|
+
if (latestValidationValueRef.current === requestedValue) {
|
|
192
|
+
setIsValidating(false);
|
|
193
|
+
}
|
|
194
|
+
}, 500);
|
|
185
195
|
}
|
|
186
196
|
async function onSave() {
|
|
187
197
|
var _a, _b;
|
|
@@ -208,8 +218,8 @@ export function useShareLink(props) {
|
|
|
208
218
|
const errorCode = (_a = e === null || e === void 0 ? void 0 : e.extensions) === null || _a === void 0 ? void 0 : _a.code;
|
|
209
219
|
setValidationError((_b = mapErrorCodeToInfo(errorCode)) !== null && _b !== void 0 ? _b : {
|
|
210
220
|
code: null,
|
|
211
|
-
title:
|
|
212
|
-
description: (e === null || e === void 0 ? void 0 : e.message) ||
|
|
221
|
+
title: props.saveErrorTitle,
|
|
222
|
+
description: (e === null || e === void 0 ? void 0 : e.message) || props.saveErrorDescription,
|
|
213
223
|
});
|
|
214
224
|
}
|
|
215
225
|
}
|
|
@@ -218,6 +228,9 @@ export function useShareLink(props) {
|
|
|
218
228
|
setEditValue("");
|
|
219
229
|
setValidationError(null);
|
|
220
230
|
setIsValidating(false);
|
|
231
|
+
latestValidationValueRef.current = "";
|
|
232
|
+
if (debounceTimerRef.current)
|
|
233
|
+
clearTimeout(debounceTimerRef.current);
|
|
221
234
|
}
|
|
222
235
|
return {
|
|
223
236
|
copyTextViewProps: {
|
|
@@ -230,7 +243,11 @@ export function useShareLink(props) {
|
|
|
230
243
|
allowCustomization: props.allowCustomization,
|
|
231
244
|
customizeLinkLabel: props.customizeLinkButtonLabel,
|
|
232
245
|
saveLabelText: props.saveLabelText,
|
|
246
|
+
savingLabelText: props.savingLabelText,
|
|
233
247
|
cancelLabelText: props.cancelLabelText,
|
|
248
|
+
editLabelText: props.editLabelText,
|
|
249
|
+
charactersRemainingText: props.charactersRemainingText,
|
|
250
|
+
validatingLabelText: props.validatingLabelText,
|
|
234
251
|
isEditing,
|
|
235
252
|
editValue,
|
|
236
253
|
domainPrefix,
|
|
@@ -14,7 +14,7 @@ import { l as luxon } from './luxon-1be92a8e.js';
|
|
|
14
14
|
import { p as pathToRegexp } from './index-ffa26b43.js';
|
|
15
15
|
import { o as optimizeCloudinaryUrl } from './imageUrl-4775f17b.js';
|
|
16
16
|
import { a as isValidColor, b as isMobile } from './utilities-77b1e0cc.js';
|
|
17
|
-
import { a as PortalSectionView, P as PortalContainerView } from './sqm-portal-container-view-
|
|
17
|
+
import { a as PortalSectionView, P as PortalContainerView } from './sqm-portal-container-view-200c9df8.js';
|
|
18
18
|
|
|
19
19
|
function BigStatView(props) {
|
|
20
20
|
const { statvalue, flexReverse, alignment, statTextColor, statFontSize, descriptionTextColor, descriptionFontSize, statFontWeight, } = props;
|
|
@@ -4234,7 +4234,7 @@ const vanillaStyle$6 = `
|
|
|
4234
4234
|
}
|
|
4235
4235
|
`;
|
|
4236
4236
|
function ShareLinkView(props) {
|
|
4237
|
-
const { copyTextViewProps, allowCustomization, customizeLinkLabel, saveLabelText, cancelLabelText, isEditing, editValue, domainPrefix, editsRemaining,
|
|
4237
|
+
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;
|
|
4238
4238
|
const style = {
|
|
4239
4239
|
Container: {
|
|
4240
4240
|
display: "flex",
|
|
@@ -4291,16 +4291,13 @@ function ShareLinkView(props) {
|
|
|
4291
4291
|
lineHeight: "var(--sl-input-height-medium)",
|
|
4292
4292
|
},
|
|
4293
4293
|
EditInput: {
|
|
4294
|
-
|
|
4295
|
-
|
|
4296
|
-
|
|
4297
|
-
|
|
4298
|
-
|
|
4299
|
-
|
|
4300
|
-
|
|
4301
|
-
background: "transparent",
|
|
4302
|
-
lineHeight: "var(--sl-input-height-medium)",
|
|
4303
|
-
minWidth: "0",
|
|
4294
|
+
"&::part(base)": {
|
|
4295
|
+
border: "none",
|
|
4296
|
+
borderRadius: "0",
|
|
4297
|
+
},
|
|
4298
|
+
"&::part(input)": {
|
|
4299
|
+
margin: 0,
|
|
4300
|
+
},
|
|
4304
4301
|
},
|
|
4305
4302
|
EditLabel: {
|
|
4306
4303
|
margin: "0",
|
|
@@ -4371,10 +4368,10 @@ function ShareLinkView(props) {
|
|
|
4371
4368
|
h("style", { type: "text/css" },
|
|
4372
4369
|
styleString,
|
|
4373
4370
|
vanillaStyle$6),
|
|
4374
|
-
h("p", { class: sheet.classes.EditLabel },
|
|
4371
|
+
h("p", { class: sheet.classes.EditLabel }, editLabelText),
|
|
4375
4372
|
h("div", { class: sheet.classes.EditInputWrapper },
|
|
4376
4373
|
h("span", { class: sheet.classes.DomainPrefix }, domainPrefix),
|
|
4377
|
-
h("input", { class: sheet.classes.EditInput, type: "text", value: editValue, onInput: (e) => onEditValueChange(e.target.value), onKeyDown: (e) => {
|
|
4374
|
+
h("sl-input", { class: sheet.classes.EditInput, type: "text", value: editValue, onInput: (e) => onEditValueChange(e.target.value), onKeyDown: (e) => {
|
|
4378
4375
|
if (e.key === "/" || e.key === "@")
|
|
4379
4376
|
e.preventDefault();
|
|
4380
4377
|
}, disabled: isSaving, maxLength: characterLimit })),
|
|
@@ -4383,17 +4380,20 @@ function ShareLinkView(props) {
|
|
|
4383
4380
|
" ",
|
|
4384
4381
|
charactersRemaining > 12 && minCharactersText,
|
|
4385
4382
|
showCharactersRemaining &&
|
|
4386
|
-
`
|
|
4383
|
+
` ${intl.formatMessage({
|
|
4384
|
+
id: "charactersRemainingText",
|
|
4385
|
+
defaultMessage: charactersRemainingText,
|
|
4386
|
+
}, { charactersRemaining })}`),
|
|
4387
4387
|
validationError && (h("sqm-form-message", { type: errorMessageType, style: { paddingBottom: "var(--sl-spacing-xx-small)" } },
|
|
4388
4388
|
h("p", { part: "alert-title" }, validationError.title),
|
|
4389
4389
|
validationError.description)),
|
|
4390
|
-
isValidating && h("p", { class: sheet.classes.HelperText },
|
|
4390
|
+
isValidating && (h("p", { class: sheet.classes.HelperText }, validatingLabelText)),
|
|
4391
4391
|
h("div", { class: sheet.classes.ActionRow },
|
|
4392
4392
|
h("button", { class: sheet.classes.SaveButton, onClick: onSave, disabled: isSaving ||
|
|
4393
4393
|
isValidating ||
|
|
4394
4394
|
!!validationError ||
|
|
4395
4395
|
!editValue ||
|
|
4396
|
-
editValue.length < minCharacters }, isSaving ?
|
|
4396
|
+
editValue.length < minCharacters }, isSaving ? savingLabelText : saveLabelText),
|
|
4397
4397
|
h("sl-button", { type: "text", class: sheet.classes.CancelButton, onClick: onCancel, disabled: isSaving }, cancelLabelText))));
|
|
4398
4398
|
}
|
|
4399
4399
|
// Default / Customized / Limit reached states
|
|
@@ -4513,6 +4513,7 @@ function useShareLink(props) {
|
|
|
4513
4513
|
const [validationError, setValidationError] = useState(null);
|
|
4514
4514
|
const [isValidating, setIsValidating] = useState(false);
|
|
4515
4515
|
const debounceTimerRef = useRef(undefined);
|
|
4516
|
+
const latestValidationValueRef = useRef("");
|
|
4516
4517
|
const hasPrimaryLinkDomain = ((_c = linkDomainData === null || linkDomainData === void 0 ? void 0 : linkDomainData.tenantSettings) === null || _c === void 0 ? void 0 : _c.primaryLinkDomain) != null;
|
|
4517
4518
|
const customizeDisabled = !hasPrimaryLinkDomain;
|
|
4518
4519
|
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;
|
|
@@ -4575,6 +4576,7 @@ function useShareLink(props) {
|
|
|
4575
4576
|
const trimmed = value.slice(0, CHARACTER_LIMIT);
|
|
4576
4577
|
setEditValue(trimmed);
|
|
4577
4578
|
setValidationError(null);
|
|
4579
|
+
latestValidationValueRef.current = trimmed;
|
|
4578
4580
|
if (debounceTimerRef.current)
|
|
4579
4581
|
clearTimeout(debounceTimerRef.current);
|
|
4580
4582
|
if (!trimmed || trimmed.length < MIN_CHARACTERS) {
|
|
@@ -4584,8 +4586,12 @@ function useShareLink(props) {
|
|
|
4584
4586
|
setIsValidating(true);
|
|
4585
4587
|
debounceTimerRef.current = setTimeout(async () => {
|
|
4586
4588
|
var _a, _b;
|
|
4589
|
+
const requestedValue = trimmed;
|
|
4587
4590
|
try {
|
|
4588
|
-
const result = await validateLinkCode({ linkCode:
|
|
4591
|
+
const result = await validateLinkCode({ linkCode: requestedValue });
|
|
4592
|
+
// Discard stale responses if the user has continued typing
|
|
4593
|
+
if (latestValidationValueRef.current !== requestedValue)
|
|
4594
|
+
return;
|
|
4589
4595
|
if (!((_a = result === null || result === void 0 ? void 0 : result.validateLinkCode) === null || _a === void 0 ? void 0 : _a.valid)) {
|
|
4590
4596
|
const reason = (_b = result === null || result === void 0 ? void 0 : result.validateLinkCode) === null || _b === void 0 ? void 0 : _b.invalidReason;
|
|
4591
4597
|
setValidationError(mapErrorCodeToInfo(reason));
|
|
@@ -4593,9 +4599,13 @@ function useShareLink(props) {
|
|
|
4593
4599
|
}
|
|
4594
4600
|
catch {
|
|
4595
4601
|
// Validation query failed — don't block the user
|
|
4602
|
+
if (latestValidationValueRef.current !== requestedValue)
|
|
4603
|
+
return;
|
|
4596
4604
|
}
|
|
4597
|
-
|
|
4598
|
-
|
|
4605
|
+
if (latestValidationValueRef.current === requestedValue) {
|
|
4606
|
+
setIsValidating(false);
|
|
4607
|
+
}
|
|
4608
|
+
}, 500);
|
|
4599
4609
|
}
|
|
4600
4610
|
async function onSave() {
|
|
4601
4611
|
var _a, _b;
|
|
@@ -4622,8 +4632,8 @@ function useShareLink(props) {
|
|
|
4622
4632
|
const errorCode = (_a = e === null || e === void 0 ? void 0 : e.extensions) === null || _a === void 0 ? void 0 : _a.code;
|
|
4623
4633
|
setValidationError((_b = mapErrorCodeToInfo(errorCode)) !== null && _b !== void 0 ? _b : {
|
|
4624
4634
|
code: null,
|
|
4625
|
-
title:
|
|
4626
|
-
description: (e === null || e === void 0 ? void 0 : e.message) ||
|
|
4635
|
+
title: props.saveErrorTitle,
|
|
4636
|
+
description: (e === null || e === void 0 ? void 0 : e.message) || props.saveErrorDescription,
|
|
4627
4637
|
});
|
|
4628
4638
|
}
|
|
4629
4639
|
}
|
|
@@ -4632,6 +4642,9 @@ function useShareLink(props) {
|
|
|
4632
4642
|
setEditValue("");
|
|
4633
4643
|
setValidationError(null);
|
|
4634
4644
|
setIsValidating(false);
|
|
4645
|
+
latestValidationValueRef.current = "";
|
|
4646
|
+
if (debounceTimerRef.current)
|
|
4647
|
+
clearTimeout(debounceTimerRef.current);
|
|
4635
4648
|
}
|
|
4636
4649
|
return {
|
|
4637
4650
|
copyTextViewProps: {
|
|
@@ -4644,7 +4657,11 @@ function useShareLink(props) {
|
|
|
4644
4657
|
allowCustomization: props.allowCustomization,
|
|
4645
4658
|
customizeLinkLabel: props.customizeLinkButtonLabel,
|
|
4646
4659
|
saveLabelText: props.saveLabelText,
|
|
4660
|
+
savingLabelText: props.savingLabelText,
|
|
4647
4661
|
cancelLabelText: props.cancelLabelText,
|
|
4662
|
+
editLabelText: props.editLabelText,
|
|
4663
|
+
charactersRemainingText: props.charactersRemainingText,
|
|
4664
|
+
validatingLabelText: props.validatingLabelText,
|
|
4648
4665
|
isEditing,
|
|
4649
4666
|
editValue,
|
|
4650
4667
|
domainPrefix,
|