@drawbridge/drawbridge-utils 0.0.52 → 0.0.54

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.
@@ -0,0 +1,190 @@
1
+ var __defProp = Object.defineProperty;
2
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
+ var __getOwnPropNames = Object.getOwnPropertyNames;
4
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
5
+ var __export = (target, all) => {
6
+ for (var name in all)
7
+ __defProp(target, name, { get: all[name], enumerable: true });
8
+ };
9
+ var __copyProps = (to, from, except, desc) => {
10
+ if (from && typeof from === "object" || typeof from === "function") {
11
+ for (let key of __getOwnPropNames(from))
12
+ if (!__hasOwnProp.call(to, key) && key !== except)
13
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
14
+ }
15
+ return to;
16
+ };
17
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
18
+
19
+ // lib/features.js
20
+ var features_exports = {};
21
+ __export(features_exports, {
22
+ connection: () => connection,
23
+ field: () => field,
24
+ fields: () => fields,
25
+ integration: () => integration,
26
+ organization: () => organization,
27
+ page: () => page
28
+ });
29
+ module.exports = __toCommonJS(features_exports);
30
+ var page = {
31
+ qrcode: {
32
+ key: "page:qrcode",
33
+ error: "Plan does not include qrcodes",
34
+ feature: "Page qrcode management"
35
+ },
36
+ shortcode: {
37
+ key: "page:shortcode",
38
+ error: "Plan does not include shortcodes",
39
+ feature: "Page shortcode management"
40
+ },
41
+ slug: {
42
+ key: "page:slug",
43
+ error: "Plan does not include url customization",
44
+ feature: "Page slug customization"
45
+ }
46
+ };
47
+ var fields = {
48
+ additional: {
49
+ key: "campaign:fields:additional",
50
+ error: "Plan does not include additional fields",
51
+ feature: "Campaign additional fields"
52
+ },
53
+ lead: {
54
+ key: "campaign:fields:lead",
55
+ error: "Plan does not include lead fields",
56
+ feature: "Campaign lead fields"
57
+ }
58
+ };
59
+ var field = {
60
+ email: {
61
+ key: "campaign:field:email",
62
+ error: "Plan does not include email field",
63
+ feature: "Campaign email field"
64
+ },
65
+ name: {
66
+ key: "campaign:field:name",
67
+ error: "Plan does not include name field",
68
+ feature: "Campaign name field"
69
+ },
70
+ number: {
71
+ key: "campaign:field:name",
72
+ error: "Plan does not include number field",
73
+ feature: "Campaign number field"
74
+ },
75
+ phone: {
76
+ key: "campaign:field:phone",
77
+ error: "Plan does not include phone field",
78
+ feature: "Campaign phone field"
79
+ },
80
+ select: {
81
+ key: "campaign:field:select",
82
+ error: "Plan does not include dropdown field",
83
+ feature: "Campaign dropdown field"
84
+ },
85
+ text: {
86
+ key: "campaign:field:text",
87
+ error: "Plan does not include short text field",
88
+ feature: "Campaign short text field"
89
+ },
90
+ textarea: {
91
+ key: "campaign:field:textarea",
92
+ error: "Plan does not include long text field",
93
+ feature: "Campaign long text field"
94
+ }
95
+ };
96
+ var connection = {
97
+ mailchimp: {
98
+ key: "organization:connection:mailchimp",
99
+ error: "Plan does not include Mailchimp connection",
100
+ feature: "Mailchimp connection"
101
+ },
102
+ sendgrid: {
103
+ key: "organization:connection:sendgrid",
104
+ error: "Plan does not include SendGrid connection",
105
+ feature: "SendGrid connection"
106
+ },
107
+ shopify: {
108
+ key: "organization:connection:shopify",
109
+ error: "Plan does not include Shopify connection",
110
+ feature: "Shopify connection"
111
+ },
112
+ twilio: {
113
+ key: "organization:connection:twilio",
114
+ error: "Plan does not include Twilio connection",
115
+ feature: "Twilio connection"
116
+ },
117
+ webhook: {
118
+ key: "organization:connection:webhook",
119
+ error: "Plan does not include Webhook connection",
120
+ feature: "Webhook connection"
121
+ }
122
+ };
123
+ var integration = {
124
+ age: {
125
+ key: "campaign:integration:age",
126
+ error: "Plan does not include age gate",
127
+ feature: "Age gate integration"
128
+ },
129
+ geocode: {
130
+ key: "campaign:integration:geocode",
131
+ error: "Plan does not include geocoding",
132
+ feature: "Google Maps Geocode integration"
133
+ },
134
+ gtm: {
135
+ key: "campaign:integration:gtm",
136
+ error: "Plan does not include GTM",
137
+ feature: "Google Tag Manager integration"
138
+ },
139
+ recaptcha: {
140
+ key: "campaign:integration:recaptcha",
141
+ error: "Plan does not include recaptcha",
142
+ feature: "Recaptcha integration"
143
+ }
144
+ };
145
+ var organization = {
146
+ advertisements: {
147
+ key: "organization:advertisements",
148
+ error: "Your plan does not include advertisements",
149
+ feature: "Organization advertisement management"
150
+ },
151
+ affiliates: {
152
+ key: "organization:affiliates",
153
+ error: "Your plan does not include affiliates",
154
+ feature: "Organization affiliates management"
155
+ },
156
+ analytics: {
157
+ key: "organization:analytics",
158
+ error: "Your plan does not include analytics",
159
+ feature: "Organization analytics management"
160
+ },
161
+ brands: {
162
+ key: "organization:brands",
163
+ error: "Your plan does not include brands",
164
+ feature: "Organization brands management"
165
+ },
166
+ members: {
167
+ key: "organization:members",
168
+ error: "Your plan does not include team members",
169
+ feature: "Organization members management"
170
+ },
171
+ reports: {
172
+ key: "organization:report",
173
+ error: "Plan does not include report generation",
174
+ feature: "Organization report generation"
175
+ },
176
+ subdomain: {
177
+ key: "organization:subdomain",
178
+ error: "Plan does not include subdomain customization",
179
+ feature: "Organization subdomain customization"
180
+ }
181
+ };
182
+ // Annotate the CommonJS export names for ESM import in node:
183
+ 0 && (module.exports = {
184
+ connection,
185
+ field,
186
+ fields,
187
+ integration,
188
+ organization,
189
+ page
190
+ });
@@ -0,0 +1,159 @@
1
+ const page = {
2
+ qrcode : {
3
+ key : 'page:qrcode',
4
+ error : 'Plan does not include qrcodes',
5
+ feature : 'Page qrcode management',
6
+ },
7
+ shortcode : {
8
+ key : 'page:shortcode',
9
+ error : 'Plan does not include shortcodes',
10
+ feature : 'Page shortcode management',
11
+ },
12
+ slug : {
13
+ key : 'page:slug',
14
+ error : 'Plan does not include url customization',
15
+ feature : 'Page slug customization',
16
+ }
17
+ };
18
+
19
+ const fields = {
20
+ additional : {
21
+ key : 'campaign:fields:additional',
22
+ error : 'Plan does not include additional fields',
23
+ feature : 'Campaign additional fields'
24
+ },
25
+ lead : {
26
+ key : 'campaign:fields:lead',
27
+ error : 'Plan does not include lead fields',
28
+ feature : 'Campaign lead fields'
29
+ }
30
+ };
31
+
32
+ const field = {
33
+ email : {
34
+ key : 'campaign:field:email',
35
+ error : 'Plan does not include email field',
36
+ feature : 'Campaign email field',
37
+ },
38
+ name : {
39
+ key : 'campaign:field:name',
40
+ error : 'Plan does not include name field',
41
+ feature : 'Campaign name field',
42
+ },
43
+ number : {
44
+ key : 'campaign:field:name',
45
+ error : 'Plan does not include number field',
46
+ feature : 'Campaign number field',
47
+ },
48
+ phone : {
49
+ key : 'campaign:field:phone',
50
+ error : 'Plan does not include phone field',
51
+ feature : 'Campaign phone field',
52
+ },
53
+ select : {
54
+ key : 'campaign:field:select',
55
+ error : 'Plan does not include dropdown field',
56
+ feature : 'Campaign dropdown field',
57
+ },
58
+ text : {
59
+ key : 'campaign:field:text',
60
+ error : 'Plan does not include short text field',
61
+ feature : 'Campaign short text field',
62
+ },
63
+ textarea : {
64
+ key : 'campaign:field:textarea',
65
+ error : 'Plan does not include long text field',
66
+ feature : 'Campaign long text field',
67
+ }
68
+ };
69
+
70
+ const connection = {
71
+ mailchimp : {
72
+ key : 'organization:connection:mailchimp',
73
+ error : 'Plan does not include Mailchimp connection',
74
+ feature : 'Mailchimp connection'
75
+ },
76
+ sendgrid : {
77
+ key : 'organization:connection:sendgrid',
78
+ error : 'Plan does not include SendGrid connection',
79
+ feature : 'SendGrid connection'
80
+ },
81
+ shopify : {
82
+ key : 'organization:connection:shopify',
83
+ error : 'Plan does not include Shopify connection',
84
+ feature : 'Shopify connection',
85
+ },
86
+ twilio : {
87
+ key : 'organization:connection:twilio',
88
+ error : 'Plan does not include Twilio connection',
89
+ feature : 'Twilio connection'
90
+ },
91
+ webhook : {
92
+ key : 'organization:connection:webhook',
93
+ error : 'Plan does not include Webhook connection',
94
+ feature : 'Webhook connection'
95
+ }
96
+ };
97
+
98
+ const integration = {
99
+ age : {
100
+ key : 'campaign:integration:age',
101
+ error : 'Plan does not include age gate',
102
+ feature : 'Age gate integration',
103
+ },
104
+ geocode : {
105
+ key : 'campaign:integration:geocode',
106
+ error : 'Plan does not include geocoding',
107
+ feature : 'Google Maps Geocode integration',
108
+ },
109
+ gtm : {
110
+ key : 'campaign:integration:gtm',
111
+ error : 'Plan does not include GTM',
112
+ feature : 'Google Tag Manager integration',
113
+ },
114
+ recaptcha : {
115
+ key : 'campaign:integration:recaptcha',
116
+ error : 'Plan does not include recaptcha',
117
+ feature : 'Recaptcha integration',
118
+ }
119
+ };
120
+
121
+ const organization = {
122
+ advertisements : {
123
+ key : 'organization:advertisements',
124
+ error : 'Your plan does not include advertisements',
125
+ feature : 'Organization advertisement management',
126
+ },
127
+ affiliates : {
128
+ key : 'organization:affiliates',
129
+ error : 'Your plan does not include affiliates',
130
+ feature : 'Organization affiliates management',
131
+ },
132
+ analytics : {
133
+ key : 'organization:analytics',
134
+ error : 'Your plan does not include analytics',
135
+ feature : 'Organization analytics management',
136
+ },
137
+ brands : {
138
+ key : 'organization:brands',
139
+ error : 'Your plan does not include brands',
140
+ feature : 'Organization brands management',
141
+ },
142
+ members : {
143
+ key : 'organization:members',
144
+ error : 'Your plan does not include team members',
145
+ feature : 'Organization members management',
146
+ },
147
+ reports : {
148
+ key : 'organization:report',
149
+ error : 'Plan does not include report generation',
150
+ feature : 'Organization report generation'
151
+ },
152
+ subdomain : {
153
+ key : 'organization:subdomain',
154
+ error : 'Plan does not include subdomain customization',
155
+ feature : 'Organization subdomain customization',
156
+ }
157
+ };
158
+
159
+ export { connection, field, fields, integration, organization, page };
@@ -0,0 +1,159 @@
1
+ const page = {
2
+ qrcode : {
3
+ key : 'page:qrcode',
4
+ error : 'Plan does not include qrcodes',
5
+ feature : 'Page qrcode management',
6
+ },
7
+ shortcode : {
8
+ key : 'page:shortcode',
9
+ error : 'Plan does not include shortcodes',
10
+ feature : 'Page shortcode management',
11
+ },
12
+ slug : {
13
+ key : 'page:slug',
14
+ error : 'Plan does not include url customization',
15
+ feature : 'Page slug customization',
16
+ }
17
+ };
18
+
19
+ const fields = {
20
+ additional : {
21
+ key : 'campaign:fields:additional',
22
+ error : 'Plan does not include additional fields',
23
+ feature : 'Campaign additional fields'
24
+ },
25
+ lead : {
26
+ key : 'campaign:fields:lead',
27
+ error : 'Plan does not include lead fields',
28
+ feature : 'Campaign lead fields'
29
+ }
30
+ };
31
+
32
+ const field = {
33
+ email : {
34
+ key : 'campaign:field:email',
35
+ error : 'Plan does not include email field',
36
+ feature : 'Campaign email field',
37
+ },
38
+ name : {
39
+ key : 'campaign:field:name',
40
+ error : 'Plan does not include name field',
41
+ feature : 'Campaign name field',
42
+ },
43
+ number : {
44
+ key : 'campaign:field:name',
45
+ error : 'Plan does not include number field',
46
+ feature : 'Campaign number field',
47
+ },
48
+ phone : {
49
+ key : 'campaign:field:phone',
50
+ error : 'Plan does not include phone field',
51
+ feature : 'Campaign phone field',
52
+ },
53
+ select : {
54
+ key : 'campaign:field:select',
55
+ error : 'Plan does not include dropdown field',
56
+ feature : 'Campaign dropdown field',
57
+ },
58
+ text : {
59
+ key : 'campaign:field:text',
60
+ error : 'Plan does not include short text field',
61
+ feature : 'Campaign short text field',
62
+ },
63
+ textarea : {
64
+ key : 'campaign:field:textarea',
65
+ error : 'Plan does not include long text field',
66
+ feature : 'Campaign long text field',
67
+ }
68
+ };
69
+
70
+ const connection = {
71
+ mailchimp : {
72
+ key : 'organization:connection:mailchimp',
73
+ error : 'Plan does not include Mailchimp connection',
74
+ feature : 'Mailchimp connection'
75
+ },
76
+ sendgrid : {
77
+ key : 'organization:connection:sendgrid',
78
+ error : 'Plan does not include SendGrid connection',
79
+ feature : 'SendGrid connection'
80
+ },
81
+ shopify : {
82
+ key : 'organization:connection:shopify',
83
+ error : 'Plan does not include Shopify connection',
84
+ feature : 'Shopify connection',
85
+ },
86
+ twilio : {
87
+ key : 'organization:connection:twilio',
88
+ error : 'Plan does not include Twilio connection',
89
+ feature : 'Twilio connection'
90
+ },
91
+ webhook : {
92
+ key : 'organization:connection:webhook',
93
+ error : 'Plan does not include Webhook connection',
94
+ feature : 'Webhook connection'
95
+ }
96
+ };
97
+
98
+ const integration = {
99
+ age : {
100
+ key : 'campaign:integration:age',
101
+ error : 'Plan does not include age gate',
102
+ feature : 'Age gate integration',
103
+ },
104
+ geocode : {
105
+ key : 'campaign:integration:geocode',
106
+ error : 'Plan does not include geocoding',
107
+ feature : 'Google Maps Geocode integration',
108
+ },
109
+ gtm : {
110
+ key : 'campaign:integration:gtm',
111
+ error : 'Plan does not include GTM',
112
+ feature : 'Google Tag Manager integration',
113
+ },
114
+ recaptcha : {
115
+ key : 'campaign:integration:recaptcha',
116
+ error : 'Plan does not include recaptcha',
117
+ feature : 'Recaptcha integration',
118
+ }
119
+ };
120
+
121
+ const organization = {
122
+ advertisements : {
123
+ key : 'organization:advertisements',
124
+ error : 'Your plan does not include advertisements',
125
+ feature : 'Organization advertisement management',
126
+ },
127
+ affiliates : {
128
+ key : 'organization:affiliates',
129
+ error : 'Your plan does not include affiliates',
130
+ feature : 'Organization affiliates management',
131
+ },
132
+ analytics : {
133
+ key : 'organization:analytics',
134
+ error : 'Your plan does not include analytics',
135
+ feature : 'Organization analytics management',
136
+ },
137
+ brands : {
138
+ key : 'organization:brands',
139
+ error : 'Your plan does not include brands',
140
+ feature : 'Organization brands management',
141
+ },
142
+ members : {
143
+ key : 'organization:members',
144
+ error : 'Your plan does not include team members',
145
+ feature : 'Organization members management',
146
+ },
147
+ reports : {
148
+ key : 'organization:report',
149
+ error : 'Plan does not include report generation',
150
+ feature : 'Organization report generation'
151
+ },
152
+ subdomain : {
153
+ key : 'organization:subdomain',
154
+ error : 'Plan does not include subdomain customization',
155
+ feature : 'Organization subdomain customization',
156
+ }
157
+ };
158
+
159
+ export { connection, field, fields, integration, organization, page };
@@ -0,0 +1,161 @@
1
+ // lib/features.js
2
+ var page = {
3
+ qrcode: {
4
+ key: "page:qrcode",
5
+ error: "Plan does not include qrcodes",
6
+ feature: "Page qrcode management"
7
+ },
8
+ shortcode: {
9
+ key: "page:shortcode",
10
+ error: "Plan does not include shortcodes",
11
+ feature: "Page shortcode management"
12
+ },
13
+ slug: {
14
+ key: "page:slug",
15
+ error: "Plan does not include url customization",
16
+ feature: "Page slug customization"
17
+ }
18
+ };
19
+ var fields = {
20
+ additional: {
21
+ key: "campaign:fields:additional",
22
+ error: "Plan does not include additional fields",
23
+ feature: "Campaign additional fields"
24
+ },
25
+ lead: {
26
+ key: "campaign:fields:lead",
27
+ error: "Plan does not include lead fields",
28
+ feature: "Campaign lead fields"
29
+ }
30
+ };
31
+ var field = {
32
+ email: {
33
+ key: "campaign:field:email",
34
+ error: "Plan does not include email field",
35
+ feature: "Campaign email field"
36
+ },
37
+ name: {
38
+ key: "campaign:field:name",
39
+ error: "Plan does not include name field",
40
+ feature: "Campaign name field"
41
+ },
42
+ number: {
43
+ key: "campaign:field:name",
44
+ error: "Plan does not include number field",
45
+ feature: "Campaign number field"
46
+ },
47
+ phone: {
48
+ key: "campaign:field:phone",
49
+ error: "Plan does not include phone field",
50
+ feature: "Campaign phone field"
51
+ },
52
+ select: {
53
+ key: "campaign:field:select",
54
+ error: "Plan does not include dropdown field",
55
+ feature: "Campaign dropdown field"
56
+ },
57
+ text: {
58
+ key: "campaign:field:text",
59
+ error: "Plan does not include short text field",
60
+ feature: "Campaign short text field"
61
+ },
62
+ textarea: {
63
+ key: "campaign:field:textarea",
64
+ error: "Plan does not include long text field",
65
+ feature: "Campaign long text field"
66
+ }
67
+ };
68
+ var connection = {
69
+ mailchimp: {
70
+ key: "organization:connection:mailchimp",
71
+ error: "Plan does not include Mailchimp connection",
72
+ feature: "Mailchimp connection"
73
+ },
74
+ sendgrid: {
75
+ key: "organization:connection:sendgrid",
76
+ error: "Plan does not include SendGrid connection",
77
+ feature: "SendGrid connection"
78
+ },
79
+ shopify: {
80
+ key: "organization:connection:shopify",
81
+ error: "Plan does not include Shopify connection",
82
+ feature: "Shopify connection"
83
+ },
84
+ twilio: {
85
+ key: "organization:connection:twilio",
86
+ error: "Plan does not include Twilio connection",
87
+ feature: "Twilio connection"
88
+ },
89
+ webhook: {
90
+ key: "organization:connection:webhook",
91
+ error: "Plan does not include Webhook connection",
92
+ feature: "Webhook connection"
93
+ }
94
+ };
95
+ var integration = {
96
+ age: {
97
+ key: "campaign:integration:age",
98
+ error: "Plan does not include age gate",
99
+ feature: "Age gate integration"
100
+ },
101
+ geocode: {
102
+ key: "campaign:integration:geocode",
103
+ error: "Plan does not include geocoding",
104
+ feature: "Google Maps Geocode integration"
105
+ },
106
+ gtm: {
107
+ key: "campaign:integration:gtm",
108
+ error: "Plan does not include GTM",
109
+ feature: "Google Tag Manager integration"
110
+ },
111
+ recaptcha: {
112
+ key: "campaign:integration:recaptcha",
113
+ error: "Plan does not include recaptcha",
114
+ feature: "Recaptcha integration"
115
+ }
116
+ };
117
+ var organization = {
118
+ advertisements: {
119
+ key: "organization:advertisements",
120
+ error: "Your plan does not include advertisements",
121
+ feature: "Organization advertisement management"
122
+ },
123
+ affiliates: {
124
+ key: "organization:affiliates",
125
+ error: "Your plan does not include affiliates",
126
+ feature: "Organization affiliates management"
127
+ },
128
+ analytics: {
129
+ key: "organization:analytics",
130
+ error: "Your plan does not include analytics",
131
+ feature: "Organization analytics management"
132
+ },
133
+ brands: {
134
+ key: "organization:brands",
135
+ error: "Your plan does not include brands",
136
+ feature: "Organization brands management"
137
+ },
138
+ members: {
139
+ key: "organization:members",
140
+ error: "Your plan does not include team members",
141
+ feature: "Organization members management"
142
+ },
143
+ reports: {
144
+ key: "organization:report",
145
+ error: "Plan does not include report generation",
146
+ feature: "Organization report generation"
147
+ },
148
+ subdomain: {
149
+ key: "organization:subdomain",
150
+ error: "Plan does not include subdomain customization",
151
+ feature: "Organization subdomain customization"
152
+ }
153
+ };
154
+ export {
155
+ connection,
156
+ field,
157
+ fields,
158
+ integration,
159
+ organization,
160
+ page
161
+ };
package/dist/index.cjs CHANGED
@@ -263,12 +263,12 @@ var formatCurrency = ({
263
263
  const resolvedLocale = locale || (typeof navigator !== "undefined" ? navigator == null ? void 0 : navigator.language : null) || "en-US";
264
264
  const options = {
265
265
  currency: code2,
266
+ currencyDisplay: "narrowSymbol",
266
267
  minimumFractionDigits: digits,
267
268
  maximumFractionDigits: digits,
268
269
  style: "currency"
269
270
  };
270
271
  if (display === "parts") {
271
- options.currencyDisplay = "narrowSymbol";
272
272
  const parts = new Intl.NumberFormat(resolvedLocale, options).formatToParts(value);
273
273
  const symbol = ((_a = parts.find((p) => p.type === "currency")) == null ? void 0 : _a.value) || "";
274
274
  const number = parts.filter((p) => p.type !== "currency" && p.type !== "literal").map((p) => p.value).join("");
package/dist/index.d.cts CHANGED
@@ -241,6 +241,7 @@ const formatCurrency = ({
241
241
 
242
242
  const options = {
243
243
  currency : code,
244
+ currencyDisplay : 'narrowSymbol',
244
245
  minimumFractionDigits : digits,
245
246
  maximumFractionDigits : digits,
246
247
  style : 'currency'
@@ -248,8 +249,6 @@ const formatCurrency = ({
248
249
 
249
250
  if( display === 'parts' ){
250
251
 
251
- options.currencyDisplay = 'narrowSymbol';
252
-
253
252
  const parts = new Intl.NumberFormat( resolvedLocale, options ).formatToParts( value );
254
253
 
255
254
  const symbol = parts.find( ( p ) => p.type === 'currency' )?.value || '';