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

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 (42) hide show
  1. package/dist/cjs/sqm-share-link.cjs.entry.js +271 -0
  2. package/dist/cjs/sqm-stencilbook.cjs.entry.js +1144 -588
  3. package/dist/cjs/useShareLink-1282123e.js +422 -0
  4. package/dist/cjs/useShareLink-3c22b1b9.js +448 -0
  5. package/dist/cjs/useShareLink-54e24928.js +448 -0
  6. package/dist/cjs/useShareLink-b664fbc7.js +450 -0
  7. package/dist/cjs/useShareLink-bf04b25c.js +450 -0
  8. package/dist/cjs/useShareLink-e8e2ae6d.js +448 -0
  9. package/dist/collection/components/sqm-share-link/sqm-share-link-view.js +2 -28
  10. package/dist/esm/sqm-share-link.entry.js +267 -0
  11. package/dist/esm/sqm-stencilbook.entry.js +3327 -2771
  12. package/dist/esm/useShareLink-023284f3.js +445 -0
  13. package/dist/esm/useShareLink-436e9cad.js +445 -0
  14. package/dist/esm/useShareLink-4ba01373.js +447 -0
  15. package/dist/esm/useShareLink-79056582.js +445 -0
  16. package/dist/esm/useShareLink-a3329e33.js +419 -0
  17. package/dist/esm/useShareLink-bc20ec4c.js +447 -0
  18. package/dist/esm-es5/sqm-share-link.entry.js +1 -0
  19. package/dist/esm-es5/sqm-stencilbook.entry.js +1 -1
  20. package/dist/esm-es5/useShareLink-023284f3.js +1 -0
  21. package/dist/esm-es5/useShareLink-436e9cad.js +1 -0
  22. package/dist/esm-es5/useShareLink-4ba01373.js +1 -0
  23. package/dist/esm-es5/useShareLink-79056582.js +1 -0
  24. package/dist/esm-es5/useShareLink-a3329e33.js +1 -0
  25. package/dist/esm-es5/useShareLink-bc20ec4c.js +1 -0
  26. package/dist/mint-components/sqm-share-link.entry.js +267 -0
  27. package/dist/mint-components/sqm-share-link.system.entry.js +1 -0
  28. package/dist/mint-components/sqm-stencilbook.entry.js +22106 -0
  29. package/dist/mint-components/sqm-stencilbook.system.entry.js +1 -0
  30. package/dist/mint-components/useShareLink-023284f3.js +445 -0
  31. package/dist/mint-components/useShareLink-1d7c9fd8.system.js +1 -0
  32. package/dist/mint-components/useShareLink-211e061c.system.js +1 -0
  33. package/dist/mint-components/useShareLink-2de7ffce.system.js +1 -0
  34. package/dist/mint-components/useShareLink-436e9cad.js +445 -0
  35. package/dist/mint-components/useShareLink-454939f5.system.js +1 -0
  36. package/dist/mint-components/useShareLink-4ba01373.js +447 -0
  37. package/dist/mint-components/useShareLink-79056582.js +445 -0
  38. package/dist/mint-components/useShareLink-a3329e33.js +419 -0
  39. package/dist/mint-components/useShareLink-bc20ec4c.js +447 -0
  40. package/dist/mint-components/useShareLink-c05fe151.system.js +1 -0
  41. package/dist/mint-components/useShareLink-cb5abd96.system.js +1 -0
  42. package/package.json +1 -1
@@ -0,0 +1,271 @@
1
+ 'use strict';
2
+
3
+ Object.defineProperty(exports, '__esModule', { value: true });
4
+
5
+ const index = require('./index-fd67d7bc.js');
6
+ require('./global-746daf93.js');
7
+ const domContextHooks_module = require('./dom-context-hooks.module-224e09d4.js');
8
+ const index_module = require('./index.module-c79bd5b0.js');
9
+ require('./GoogleFonts-039d880f.js');
10
+ require('./jss-preset-default.esm-b48f0c33.js');
11
+ require('./JSS-518e9b4d.js');
12
+ require('./mixins-f51b04f1.js');
13
+ const utils = require('./utils-e326d1b5.js');
14
+ const cjs = require('./cjs-2bf512b9.js');
15
+ require('./useReferralCodes-4304f68f.js');
16
+ require('./copy-text-view-fd17b89a.js');
17
+ const useShareLink = require('./useShareLink-1282123e.js');
18
+
19
+ const ShareLink = class {
20
+ constructor(hostRef) {
21
+ index.registerInstance(this, hostRef);
22
+ /**
23
+ * Shown inside a tooltip after someone has successfully copied the link to their clipboard
24
+ *
25
+ * @uiName Tooltip text
26
+ */
27
+ this.tooltiptext = "Copied to Clipboard";
28
+ /**
29
+ * The number of milliseconds that the tooltip appears for
30
+ *
31
+ * @uiName Tooltip lifespan
32
+ */
33
+ this.tooltiplifespan = 1000;
34
+ /**
35
+ * Change the text alignment
36
+ *
37
+ * @uiName Share link alignment
38
+ * @uiType string
39
+ * @uiEnum ["left", "center", "right"]
40
+ * @uiEnumNames ["Left", "Center", "Right"]
41
+ * @uiGroup Style
42
+ */
43
+ this.textAlign = "left";
44
+ /**
45
+ * @uiName Copy button label
46
+ */
47
+ this.copyButtonLabel = "Copy Link";
48
+ /**
49
+ * The type of the button that is used (primary or secondary).
50
+ * @uiName Button Type
51
+ * @uiType string
52
+ * @uiEnum ["primary", "secondary"]
53
+ * @uiEnumNames ["Primary", "Secondary"]
54
+ * @uiGroup Style
55
+ */
56
+ this.buttonType = "primary";
57
+ /**
58
+ * Set the copy button style and placement
59
+ *
60
+ * @uiName Button style
61
+ * @uiType string
62
+ * @uiEnum ["icon", "button-outside", "button-below"]
63
+ * @uiEnumNames ["Icon", "Button outside", "Button below"]
64
+ * @uiGroup Style
65
+ */
66
+ this.buttonStyle = "icon";
67
+ /**
68
+ * Enable users to customize their referral link
69
+ *
70
+ * @uiName Customize URL
71
+ * @uiType boolean
72
+ * @uiGroup Customize Vanity Link
73
+ * @requiredFlavor impact
74
+ */
75
+ this.customizeUrl = false;
76
+ /**
77
+ * Text shown below the share link input to trigger customization
78
+ *
79
+ * @uiName Customize link label
80
+ * @uiType string
81
+ * @uiGroup Customize Vanity Link
82
+ * @requiredFlavor impact
83
+ */
84
+ this.customizeLinkLabel = "Customize Link";
85
+ /**
86
+ * Text for the save button in editing mode
87
+ *
88
+ * @uiName Save button label
89
+ * @uiType string
90
+ * @uiGroup Customize Vanity Link
91
+ * @requiredFlavor impact
92
+ */
93
+ this.saveLabelText = "Save";
94
+ /**
95
+ * Text for the cancel button in editing mode
96
+ *
97
+ * @uiName Cancel button label
98
+ * @uiType string
99
+ * @uiGroup Customize Vanity Link
100
+ * @requiredFlavor impact
101
+ */
102
+ this.cancelLabelText = "Cancel";
103
+ /**
104
+ * Title text shown when the custom link is already taken
105
+ *
106
+ * @uiName Existing code conflict error title
107
+ * @uiType string
108
+ * @uiGroup Customize Vanity Link
109
+ * @requiredFlavor impact
110
+ */
111
+ this.existingCodeConflictErrorTitle = "This link is already taken";
112
+ /**
113
+ * Description text shown when the custom link is already taken
114
+ *
115
+ * @uiName Existing code conflict error description
116
+ * @uiType string
117
+ * @uiGroup Customize Vanity Link
118
+ * @requiredFlavor impact
119
+ */
120
+ this.existingCodeConflictErrorDescription = "Try adding numbers, a dash or underscore to create a unique link.";
121
+ /**
122
+ * Title text shown when the link contains invalid characters
123
+ *
124
+ * @uiName Invalid characters error title
125
+ * @uiType string
126
+ * @uiGroup Customize Vanity Link
127
+ * @requiredFlavor impact
128
+ */
129
+ this.invalidCharactersErrorTitle = "Please use only letters, numbers, dashes and underscores";
130
+ /**
131
+ * Description text shown when the link contains invalid characters
132
+ *
133
+ * @uiName Invalid characters error description
134
+ * @uiType string
135
+ * @uiGroup Customize Vanity Link
136
+ * @requiredFlavor impact
137
+ */
138
+ this.invalidCharactersErrorDescription = "Special characters can break the link when sharing.";
139
+ /**
140
+ * Title text shown when the link contains profanity
141
+ *
142
+ * @uiName Profanity error title
143
+ * @uiType string
144
+ * @uiGroup Customize Vanity Link
145
+ * @requiredFlavor impact
146
+ */
147
+ this.profanityErrorTitle = "Please try a different link";
148
+ /**
149
+ * Description text shown when the link contains profanity
150
+ *
151
+ * @uiName Profanity error description
152
+ * @uiType string
153
+ * @uiGroup Customize Vanity Link
154
+ * @requiredFlavor impact
155
+ */
156
+ this.profanityErrorDescription = "This link contains a restricted word.";
157
+ /**
158
+ * Text describing the edit limit
159
+ *
160
+ * @uiName Edit limit text
161
+ * @uiType string
162
+ * @uiGroup Customize Vanity Link
163
+ * @requiredFlavor impact
164
+ */
165
+ this.editLimitText = "You can edit your link up to 5 times.";
166
+ /**
167
+ * Message shown when the edit limit has been reached. Use {supportLink} as a placeholder for the support link.
168
+ *
169
+ * @uiName Edit limit reached text
170
+ * @uiType string
171
+ * @uiGroup Customize Vanity Link
172
+ * @requiredFlavor impact
173
+ */
174
+ this.editLimitReachedText = "5 edit limit reached. To make more changes, please contact {supportLink}.";
175
+ /**
176
+ * Display text for the support link in the edit limit reached message
177
+ *
178
+ * @uiName Support link text
179
+ * @uiType string
180
+ * @uiGroup Customize Vanity Link
181
+ * @requiredFlavor impact
182
+ */
183
+ this.supportLinkText = "Support";
184
+ /**
185
+ * Tooltip text shown when link customization is disabled
186
+ *
187
+ * @uiName Customize disabled tooltip
188
+ * @uiType string
189
+ * @uiGroup Customize Vanity Link
190
+ * @requiredFlavor impact
191
+ */
192
+ this.customizeDisabledTooltip = "Link customization is not available.";
193
+ domContextHooks_module.h$1(this);
194
+ }
195
+ disconnectedCallback() { }
196
+ render() {
197
+ const thisProps = utils.getProps(this);
198
+ const props = index_module.isDemo()
199
+ ? useDemoShareLink(thisProps)
200
+ : useShareLink.useShareLink(thisProps);
201
+ return index.h(useShareLink.ShareLinkView, Object.assign({}, props));
202
+ }
203
+ };
204
+ function useDemoShareLink(props) {
205
+ var _a;
206
+ const [open, setOpen] = domContextHooks_module.useState(false);
207
+ const [isEditing, setIsEditing] = domContextHooks_module.useState(false);
208
+ const [editValue, setEditValue] = domContextHooks_module.useState("");
209
+ const copyString = "https://www.example.com/sharelink/abc";
210
+ const domainPrefix = "https://www.example.com/";
211
+ const baseProps = {
212
+ copyTextViewProps: {
213
+ copyString,
214
+ tooltiptext: props.tooltiptext,
215
+ textAlign: props.textAlign,
216
+ buttonStyle: props.buttonStyle,
217
+ backgroundColor: props.backgroundColor,
218
+ textColor: props.textColor,
219
+ borderRadius: props.borderRadius,
220
+ buttonType: props.buttonType,
221
+ copyButtonLabel: props.copyButtonLabel,
222
+ borderColor: props.borderColor,
223
+ open,
224
+ onClick: () => {
225
+ navigator.clipboard.writeText(copyString);
226
+ setOpen(true);
227
+ setTimeout(() => setOpen(false), props.tooltiplifespan);
228
+ },
229
+ },
230
+ customizeUrl: props.customizeUrl,
231
+ customizeLinkLabel: props.customizeLinkLabel,
232
+ saveLabelText: props.saveLabelText,
233
+ cancelLabelText: props.cancelLabelText,
234
+ isEditing,
235
+ editValue,
236
+ domainPrefix,
237
+ editsRemaining: 5,
238
+ maxEdits: 5,
239
+ limitReached: false,
240
+ validationError: null,
241
+ isValidating: false,
242
+ isSaving: false,
243
+ characterLimit: 15,
244
+ minCharacters: 3,
245
+ charactersRemaining: 15 - editValue.length,
246
+ editLimitText: props.editLimitText,
247
+ editLimitReachedText: props.editLimitReachedText,
248
+ supportLinkText: props.supportLinkText,
249
+ customizeDisabled: false,
250
+ customizeDisabledTooltip: (_a = props.customizeDisabledTooltip) !== null && _a !== void 0 ? _a : "Link customization is not available.",
251
+ onCustomizeClick: () => {
252
+ setIsEditing(true);
253
+ setEditValue("");
254
+ },
255
+ onEditValueChange: (value) => {
256
+ setEditValue(value);
257
+ },
258
+ onSave: () => {
259
+ setIsEditing(false);
260
+ },
261
+ onCancel: () => {
262
+ setIsEditing(false);
263
+ setEditValue("");
264
+ },
265
+ };
266
+ return cjs.cjs(baseProps, props.demoData || {}, {
267
+ arrayMerge: (_, a) => a,
268
+ });
269
+ }
270
+
271
+ exports.sqm_share_link = ShareLink;