@leaflink/stash 44.6.1 → 44.7.0
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/README.md +106 -74
- package/dist/Image.js +114 -133
- package/dist/Image.js.map +1 -1
- package/dist/Image.vue.d.ts +28 -31
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/package.json +12 -2
package/README.md
CHANGED
|
@@ -8,26 +8,26 @@
|
|
|
8
8
|
[](https://github.com/semantic-release/semantic-release)
|
|
9
9
|
[](http://commitizen.github.io/cz-cli/)
|
|
10
10
|
|
|
11
|
-
|
|
12
|
-
|
|
11
|
+
Stash is a collection of primitive, product-agnostic elements that help encapsulate LeafLink's look and feel at base
|
|
12
|
+
level. This project is intended to be used across our digital product portfolio.
|
|
13
13
|
|
|
14
14
|
<!-- START doctoc generated TOC please keep comment here to allow auto update -->
|
|
15
15
|
<!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE -->
|
|
16
16
|
## Table of Contents
|
|
17
17
|
|
|
18
|
-
- [
|
|
18
|
+
- [Quick Start](#quick-start)
|
|
19
19
|
- [Usage](#usage)
|
|
20
20
|
- [Example](#example)
|
|
21
21
|
- [npm scripts](#npm-scripts)
|
|
22
|
-
- [Styles](#styles)
|
|
23
|
-
|
|
22
|
+
- [Legacy Styles](#legacy-styles)
|
|
23
|
+
- [Tailwind](#tailwind)
|
|
24
24
|
- [Configuration](#configuration)
|
|
25
|
-
- [Design System](#design-system)
|
|
26
25
|
- [Resources](#resources)
|
|
27
26
|
- [Core files & Entry Points](#core-files--entry-points)
|
|
28
27
|
- [à la carte](#%C3%A0-la-carte)
|
|
29
28
|
- [Peer dependencies](#peer-dependencies)
|
|
30
29
|
- [Testing](#testing)
|
|
30
|
+
- [Mocking Google Maps API when testing AddressSelect](#mocking-google-maps-api-when-testing-addressselect)
|
|
31
31
|
- [Assets](#assets)
|
|
32
32
|
- [Illustrations and Icons](#illustrations-and-icons)
|
|
33
33
|
- [Testing `Icon`'s and `Illustration`'s](#testing-icons-and-illustrations)
|
|
@@ -88,8 +88,8 @@ export default {
|
|
|
88
88
|
|
|
89
89
|
See the [Tailwind](#tailwind) section for more details on how to configure it in your app.
|
|
90
90
|
|
|
91
|
-
> [!
|
|
92
|
-
>
|
|
91
|
+
> [!NOTE] For apps still requiring deprecated css & utility classes, you can include the backwards compat styles from
|
|
92
|
+
> Stash:
|
|
93
93
|
|
|
94
94
|
```ts filename="main.ts"
|
|
95
95
|
import '@leaflink/stash/styles/backwards-compat.css'; // Add this line before the base and components styles.
|
|
@@ -120,16 +120,20 @@ export default defineConfig(({ mode }) => {
|
|
|
120
120
|
|
|
121
121
|
## Usage
|
|
122
122
|
|
|
123
|
-
`@leaflink/stash` is a Vue component library that implements
|
|
123
|
+
`@leaflink/stash` is a Vue component library that implements
|
|
124
|
+
[Leaflink's Stash Design System](https://stash.leaflink.com). So every one of LeafLink's colors, typography, shadows,
|
|
125
|
+
etc. can be accessible via tailwind utility classes like `tw-text-blue-500 tw-text-sm`.
|
|
124
126
|
|
|
125
|
-
Stash is a Vue plugin that can be installed in your app. You **do not need to install the plugin in order to use the
|
|
127
|
+
Stash is a Vue plugin that can be installed in your app. You **do not need to install the plugin in order to use the
|
|
128
|
+
components**, but it is required if you need to configure the framework to suit your specific needs.
|
|
126
129
|
|
|
127
130
|
There are several options to configure the framework to suit your specific needs, and they are all optional. Any options
|
|
128
131
|
you pass to the plugin will be merged with the default options & applied to the entire framework.
|
|
129
132
|
|
|
130
|
-
> [!WARNING]
|
|
131
|
-
>
|
|
132
|
-
>
|
|
133
|
+
> [!WARNING] If you don't install the plugin in your app, you will need to manually setup
|
|
134
|
+
> [modals](https://stash.leaflink.com/guides/modals.html#installation),
|
|
135
|
+
> [toasts](https://stash.leaflink.com/guides/toasts.html#installation), and other features that require some setup
|
|
136
|
+
> that's normally done for you by the Stash plugin.
|
|
133
137
|
|
|
134
138
|
```ts
|
|
135
139
|
interface StashPluginOptions {
|
|
@@ -203,7 +207,7 @@ const app = createApp(App);
|
|
|
203
207
|
app.use(stash, {
|
|
204
208
|
i18n: {
|
|
205
209
|
locale,
|
|
206
|
-
t: (key, value) => i18n.t(key, value)
|
|
210
|
+
t: (key, value) => i18n.t(key, value),
|
|
207
211
|
},
|
|
208
212
|
googleMapsApiKey: import.meta.env.VITE_GOOGLE_MAPS_API,
|
|
209
213
|
});
|
|
@@ -213,18 +217,24 @@ This example will load the core i18n options and Google Maps api key.
|
|
|
213
217
|
|
|
214
218
|
### npm scripts
|
|
215
219
|
|
|
216
|
-
Most operations are run using `npm run` and are defined in `package.json`. Check out the available scripts with
|
|
220
|
+
Most operations are run using `npm run` and are defined in `package.json`. Check out the available scripts with
|
|
221
|
+
`npm run`.
|
|
217
222
|
|
|
218
223
|
A few commonly used commands are:
|
|
219
224
|
|
|
220
225
|
- `npm run docs` will start the docs using Vitepress dev server on port `5180`.
|
|
221
|
-
- `npm run lint` will lint all vue/js files with eslint & lint css with `stylelint`. Optionally you can just lint js or
|
|
226
|
+
- `npm run lint` will lint all vue/js files with eslint & lint css with `stylelint`. Optionally you can just lint js or
|
|
227
|
+
css with the `lint:js` and `lint:css` scripts respectively. You can run `npm run lint --fix` to auto-fix code styles.
|
|
222
228
|
- `npm test <file>` when we want to run a single spec during active development.
|
|
223
|
-
- `npm test` runs all unit and integration tests with Vitest. `--watch` is enabled by default and you can pass any other
|
|
224
|
-
|
|
225
|
-
- `npm run
|
|
229
|
+
- `npm test` runs all unit and integration tests with Vitest. `--watch` is enabled by default and you can pass any other
|
|
230
|
+
Vitest options to this script that you'd like.
|
|
231
|
+
- `npm run test:ci` will run tests and generate coverage. Used in CI, but nothing stopping you from using it locally if
|
|
232
|
+
you want to run with coverage.
|
|
233
|
+
- `npm run type-check` will run the TypeScript compiler and perform a static analysis of the code and report any type
|
|
234
|
+
errors it finds.
|
|
226
235
|
- `npm run build` will build the application and prepare it for production.
|
|
227
|
-
- `npm run build-ts` will build the application, perform a static analysis to find any type errors and prepare it for
|
|
236
|
+
- `npm run build-ts` will build the application, perform a static analysis to find any type errors and prepare it for
|
|
237
|
+
production.
|
|
228
238
|
|
|
229
239
|
## Legacy Styles
|
|
230
240
|
|
|
@@ -257,8 +267,10 @@ import Button from '@leaflink/stash/Button.vue';
|
|
|
257
267
|
import IconLabel from '@leaflink/stash/IconLabel.vue';
|
|
258
268
|
|
|
259
269
|
<Button icon-label class="tw-hidden md:tw-inline tw-ml-3">
|
|
260
|
-
<IconLabel icon="user-add" title="Add Recipient" size="dense" stacked>
|
|
261
|
-
|
|
270
|
+
<IconLabel icon="user-add" title="Add Recipient" size="dense" stacked>
|
|
271
|
+
Add Recipient
|
|
272
|
+
</IconLabel>
|
|
273
|
+
</Button>;
|
|
262
274
|
```
|
|
263
275
|
|
|
264
276
|
### Configuration
|
|
@@ -280,30 +292,34 @@ export default {
|
|
|
280
292
|
|
|
281
293
|
## Resources
|
|
282
294
|
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
295
|
+
- **index.js**: This is the "install" entry point, for use with `app.use(...)`.
|
|
296
|
+
- **components**: All components
|
|
297
|
+
- **composables**: Similar to mixins or React's "Hooks", but for a Vue component
|
|
298
|
+
- **constants**: LeafLink global constants
|
|
299
|
+
- **directives**: [Vue directives](https://vuejs.org/guide/reusability/custom-directives#custom-directives)
|
|
300
|
+
- **plugins**: [Vue plugins](https://vuejs.org/guide/reusability/plugins.html#plugins)
|
|
301
|
+
- **styles**: SCSS, CSS, style utils, etc.
|
|
302
|
+
- **types**: TypeScript type declarations
|
|
303
|
+
- **utils**: Includes various helpers for internal and external use
|
|
292
304
|
|
|
293
305
|
## Core files & Entry Points
|
|
294
306
|
|
|
295
|
-
`index.js` is used as the main entry point to the framework. It also exports each component individually, for an _à la
|
|
307
|
+
`index.js` is used as the main entry point to the framework. It also exports each component individually, for an _à la
|
|
308
|
+
carte_ build. You may pull in the default export directly and `app.use` it (to quickly get up and running w/ all
|
|
309
|
+
components and features); or, you may wish configure it with particular options, components, or features.
|
|
296
310
|
|
|
297
311
|
## à la carte
|
|
298
312
|
|
|
299
|
-
`@leaflink/stash` serves its components and directives _à la carte_, which means that instead of importing the entire
|
|
313
|
+
`@leaflink/stash` serves its components and directives _à la carte_, which means that instead of importing the entire
|
|
314
|
+
library, you selectively import only the specific components and directives that you need for your project. This
|
|
315
|
+
approach helps reduce the bundle size of your application, resulting in faster load times and improved performance.
|
|
300
316
|
|
|
301
317
|
```js
|
|
302
318
|
// Component.vue
|
|
303
319
|
|
|
304
|
-
import Select from '@leaflink/stash/Select.vue'
|
|
320
|
+
import Select from '@leaflink/stash/Select.vue';
|
|
305
321
|
|
|
306
|
-
<Select></Select
|
|
322
|
+
<Select></Select>;
|
|
307
323
|
```
|
|
308
324
|
|
|
309
325
|
```js
|
|
@@ -311,41 +327,53 @@ import Select from '@leaflink/stash/Select.vue'
|
|
|
311
327
|
|
|
312
328
|
import autofocus from '@leaflink/stash/autofocus';
|
|
313
329
|
|
|
314
|
-
<button v-autofocus>
|
|
315
|
-
Click
|
|
316
|
-
</button>
|
|
330
|
+
<button v-autofocus>Click</button>;
|
|
317
331
|
```
|
|
318
332
|
|
|
319
333
|
## Peer dependencies
|
|
320
334
|
|
|
321
|
-
Peer dependencies are specific dependencies that a package requires to work correctly, but expects the consumer of the
|
|
335
|
+
Peer dependencies are specific dependencies that a package requires to work correctly, but expects the consumer of the
|
|
336
|
+
package to provide. In other words, they are dependencies that the package relies on, but are not bundled with the
|
|
337
|
+
package itself.
|
|
322
338
|
|
|
323
339
|
`@leaflink/stash` project requires some peer dependencies:
|
|
324
340
|
|
|
325
|
-
|
|
341
|
+
- `postcss-preset-env`: Used for transforming CSS with PostCSS. Required by [Tailwind](https://tailwindcss.com/).
|
|
342
|
+
Required compatibility with this package on version **9.x**.
|
|
326
343
|
|
|
327
|
-
|
|
344
|
+
- `tailwindcss`: Our utility-first CSS framework used for building our responsive and customizable components. Required
|
|
345
|
+
compatibility with this package on version **^3.3.1** or higher.
|
|
328
346
|
|
|
329
|
-
|
|
347
|
+
- `typescript`: Adds static type-checking to JavaScript. Required compatibility with this package on version **^5.x** or
|
|
348
|
+
higher.
|
|
330
349
|
|
|
331
|
-
|
|
350
|
+
- `vue-router`: The official router for Vue.js applications. Required compatibility with this package on version
|
|
351
|
+
**^4.x** or higher.
|
|
332
352
|
|
|
333
|
-
These peer dependencies need to be installed separately by the consumer of the package, ensuring that the correct
|
|
353
|
+
These peer dependencies need to be installed separately by the consumer of the package, ensuring that the correct
|
|
354
|
+
versions are used to maintain compatibility and avoid conflicts with other dependencies in the project.
|
|
334
355
|
|
|
335
356
|
## Testing
|
|
336
357
|
|
|
337
|
-
> [!TIP]
|
|
338
|
-
>
|
|
358
|
+
> [!TIP] If you are contributing to `@leaflink/stash`, please refer to this contributing
|
|
359
|
+
> [testing](CONTRIBUTING.md#testing) section for more details on how to properly test your changes.
|
|
339
360
|
|
|
340
361
|
To run tests, there's multiple npm scripts available to you:
|
|
341
362
|
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
363
|
+
- `npm run test` - Run all tests in watch mode.
|
|
364
|
+
- `npm run test <file>` - Run matching spec files quickly and watch for changes.
|
|
365
|
+
- `npm run test:ci` - Run tests and generate coverage. Used in CI, but nothing stopping you from using it locally if you
|
|
366
|
+
want to run with coverage.
|
|
345
367
|
|
|
346
|
-
They all run Vitest but are typically used at different times because of the default Vitest options we're passing to
|
|
368
|
+
They all run Vitest but are typically used at different times because of the default Vitest options we're passing to
|
|
369
|
+
them inside of the npm script. All of them allow you to pass any additional Vitest cli options that you'd like, i.e.
|
|
370
|
+
`npm run test -- --silent`.
|
|
347
371
|
|
|
348
|
-
Testing Library truncates the output from tests, which can cut off large DOM elements logged to the console. This limit
|
|
372
|
+
Testing Library truncates the output from tests, which can cut off large DOM elements logged to the console. This limit
|
|
373
|
+
can be adjusted with the `DEBUG_PRINT_LIMIT` environment variable, which can be set either when running tests
|
|
374
|
+
(`DEBUG_PRINT_LIMIT=100000 npm run test`) or added to your shell's profile (`export DEBUG_PRINT_LIMIT=100000`) to make
|
|
375
|
+
it the default. For more on debugging with Testing Library, see
|
|
376
|
+
[official documentation](https://testing-library.com/docs/dom-testing-library/api-debugging).
|
|
349
377
|
|
|
350
378
|
Coverage HTML reports are written to `./coverage`.
|
|
351
379
|
|
|
@@ -368,7 +396,8 @@ When testing components that use the `AddressSelect` component or `useGoogleMaps
|
|
|
368
396
|
This is because the `useGoogleMaps` composable uses the `google.maps` global object, which is not available in the
|
|
369
397
|
testing environment.
|
|
370
398
|
|
|
371
|
-
The easiest way to do this is to mock the useGoogleMaps composable and avoid trying to mock the Google Maps API
|
|
399
|
+
The easiest way to do this is to mock the useGoogleMaps composable and avoid trying to mock the Google Maps API
|
|
400
|
+
directly.
|
|
372
401
|
|
|
373
402
|
Create a file in the `__mocks__` directory of the `@leaflink/stash` package, and mock the `useGoogleMaps` composable.
|
|
374
403
|
|
|
@@ -390,12 +419,10 @@ export default function () {
|
|
|
390
419
|
};
|
|
391
420
|
}
|
|
392
421
|
|
|
393
|
-
|
|
394
422
|
/* tests/setup-env.ts */
|
|
395
423
|
import '@leaflink/dom-testing-utils/setup-env'; // to ensure lodash-es/debounce is mocked properly
|
|
396
424
|
vi.mock('@leaflink/stash/useGoogleMaps');
|
|
397
425
|
|
|
398
|
-
|
|
399
426
|
/* src/components/YourComponent.spec.ts */
|
|
400
427
|
const user = userEvent.setup();
|
|
401
428
|
// Start typing in the AddressSelect select input to trigger the useGoogleMaps mock response
|
|
@@ -405,13 +432,16 @@ await user.type(screen.getByPlaceholderText('Search'), 'type anything');
|
|
|
405
432
|
await user.selectOptions(screen.getByLabelText('Bank address'), ['1']);
|
|
406
433
|
```
|
|
407
434
|
|
|
408
|
-
It's also encouraged the use of [@leaflink/dom-testing-utils](https://github.com/LeafLink/dom-testing-utils) for testing
|
|
435
|
+
It's also encouraged the use of [@leaflink/dom-testing-utils](https://github.com/LeafLink/dom-testing-utils) for testing
|
|
436
|
+
utilities like global and local test setup, mocking endpoints, clean up components, get selected options and more.
|
|
437
|
+
Checkout the [documention](https://github.com/LeafLink/dom-testing-utils) for learning more about this package.
|
|
409
438
|
|
|
410
439
|
## Assets
|
|
411
440
|
|
|
412
441
|
When using Stash, a collection of assets are available to use, such as icons and illustrations.
|
|
413
442
|
|
|
414
|
-
In order to configure the assets path for your project, you can do it via the `staticPath` option. By default, this
|
|
443
|
+
In order to configure the assets path for your project, you can do it via the `staticPath` option. By default, this
|
|
444
|
+
property is set to the `/assets` path.
|
|
415
445
|
|
|
416
446
|
```ts
|
|
417
447
|
import { createApp } from 'vue';
|
|
@@ -420,7 +450,7 @@ import stash from '@leaflink/stash';
|
|
|
420
450
|
const app = createApp(App);
|
|
421
451
|
|
|
422
452
|
app.use(stash, {
|
|
423
|
-
staticPath: '/my-assets-path'
|
|
453
|
+
staticPath: '/my-assets-path',
|
|
424
454
|
});
|
|
425
455
|
```
|
|
426
456
|
|
|
@@ -458,38 +488,39 @@ export default defineConfig(({ mode }) => {
|
|
|
458
488
|
],
|
|
459
489
|
hook: 'buildStart',
|
|
460
490
|
}),
|
|
461
|
-
]
|
|
491
|
+
],
|
|
462
492
|
};
|
|
463
493
|
});
|
|
464
|
-
|
|
465
494
|
```
|
|
466
495
|
|
|
467
496
|
## Illustrations and Icons
|
|
468
497
|
|
|
469
498
|
It's encouraged to use Stash's `Illustration` and `Icon` components for these kind of data.
|
|
470
499
|
|
|
471
|
-
1. If your work includes a new illustration, add it here in Stash:
|
|
500
|
+
1. If your work includes a new illustration, add it here in Stash:
|
|
501
|
+
<https://github.com/LeafLink/stash/tree/main/assets/illustrations>
|
|
472
502
|
2. Import the component:
|
|
473
503
|
```js
|
|
474
|
-
import Illustration from
|
|
475
|
-
import Icon from
|
|
504
|
+
import Illustration from '@leaflink/stash/Illustration.vue';
|
|
505
|
+
import Icon from '@leaflink/stash/Icon.vue';
|
|
476
506
|
```
|
|
477
507
|
3. Use it in your template:
|
|
478
508
|
```html
|
|
479
|
-
<Illustration name="your-illustration-name" />
|
|
480
|
-
<Icon name="your-icon-name" />
|
|
509
|
+
<Illustration name="your-illustration-name" /> <Icon name="your-icon-name" />
|
|
481
510
|
```
|
|
482
511
|
4. Customize however you like: i.e:
|
|
483
512
|
```html
|
|
484
|
-
<Illustration name="your-illustration-name" :size="58" />
|
|
485
|
-
<Icon name="your-icon-name" :size="58" />
|
|
513
|
+
<Illustration name="your-illustration-name" :size="58" /> <Icon name="your-icon-name" :size="58" />
|
|
486
514
|
```
|
|
487
515
|
|
|
488
|
-
If you're working on existing templates that use `SvgIcon` using one of the newer illustrations and you feel inclined to
|
|
516
|
+
If you're working on existing templates that use `SvgIcon` using one of the newer illustrations and you feel inclined to
|
|
517
|
+
migrate it over to Stash, that would be helpful!
|
|
489
518
|
|
|
490
519
|
### Testing `Icon`'s and `Illustration`'s
|
|
491
520
|
|
|
492
|
-
The `Icon` and `Illustration` components from Stash now loads SVG's asyncronously. This is fine for tests unless you're
|
|
521
|
+
The `Icon` and `Illustration` components from Stash now loads SVG's asyncronously. This is fine for tests unless you're
|
|
522
|
+
actually looking to query for an SVG. In that event, you will just need to be sure to `await findBy...` the icon before
|
|
523
|
+
asserting on or interacting with it.
|
|
493
524
|
|
|
494
525
|
**Example**
|
|
495
526
|
|
|
@@ -501,22 +532,22 @@ The `Icon` and `Illustration` components from Stash now loads SVG's asyncronousl
|
|
|
501
532
|
```ts
|
|
502
533
|
// ❌ Fails
|
|
503
534
|
renderAccountingAmounts();
|
|
504
|
-
expect(screen.getByTestId(
|
|
535
|
+
expect(screen.getByTestId('delete-adjustment-icon')).toBeInTheDocument();
|
|
505
536
|
|
|
506
537
|
// ❌ Possible false-positives
|
|
507
538
|
renderAccountingAmounts();
|
|
508
|
-
expect(screen.queryByTestId(
|
|
539
|
+
expect(screen.queryByTestId('delete-adjustment-icon')).not.toBeInTheDocument();
|
|
509
540
|
|
|
510
541
|
// ✅ Passes
|
|
511
542
|
renderAccountingAmounts();
|
|
512
|
-
expect(await screen.findByTestId(
|
|
543
|
+
expect(await screen.findByTestId('delete-adjustment-icon')).toBeInTheDocument();
|
|
513
544
|
|
|
514
545
|
// ✅ Passes
|
|
515
|
-
import { flushPromises } from
|
|
546
|
+
import { flushPromises } from '@vue/test-utils';
|
|
516
547
|
|
|
517
548
|
renderAccountingAmounts();
|
|
518
549
|
await flushPromises();
|
|
519
|
-
expect(screen.queryByTestId(
|
|
550
|
+
expect(screen.queryByTestId('delete-adjustment-icon')).not.toBeInTheDocument();
|
|
520
551
|
```
|
|
521
552
|
|
|
522
553
|
**Details**
|
|
@@ -527,7 +558,8 @@ expect(screen.queryByTestId("delete-adjustment-icon")).not.toBeInTheDocument();
|
|
|
527
558
|
|
|
528
559
|
## Contributing
|
|
529
560
|
|
|
530
|
-
Anyone can contribute to `@leaflink/stash`! Please check out the [Contribution guide](CONTRIBUTING.md) for guidelines
|
|
561
|
+
Anyone can contribute to `@leaflink/stash`! Please check out the [Contribution guide](CONTRIBUTING.md) for guidelines
|
|
562
|
+
about how to proceed.
|
|
531
563
|
|
|
532
564
|
Reach out in [slack](https://leaflink.slack.com/archives/C012WHER0R0) if you have other questions.
|
|
533
565
|
|
package/dist/Image.js
CHANGED
|
@@ -1,29 +1,38 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
|
|
5
|
-
|
|
1
|
+
import { defineComponent as M, inject as B, computed as o, useAttrs as D, openBlock as L, createElementBlock as k, mergeProps as C, unref as N } from "vue";
|
|
2
|
+
import V from "@leaflink/snitch";
|
|
3
|
+
import { IMAGE_PROVIDER_URLS as q, SCREEN_SIZES as y } from "./constants.js";
|
|
4
|
+
import G from "lodash-es/merge";
|
|
5
|
+
const w = {
|
|
6
|
+
xs: 160,
|
|
7
|
+
sm: 338,
|
|
8
|
+
md: 676,
|
|
9
|
+
lg: 1352,
|
|
10
|
+
xl: 2704
|
|
11
|
+
};
|
|
12
|
+
var P = /* @__PURE__ */ ((e) => (e.None = "none", e.Rounded = "rounded", e))(P || {}), z = /* @__PURE__ */ ((e) => (e.Cloudinary = "cloudinary", e.Static = "static", e))(z || {});
|
|
13
|
+
function j(e) {
|
|
14
|
+
return (t) => e[t] || t;
|
|
6
15
|
}
|
|
7
|
-
function
|
|
8
|
-
formatter:
|
|
9
|
-
keyMap:
|
|
10
|
-
joinWith:
|
|
11
|
-
valueMap:
|
|
16
|
+
function Q({
|
|
17
|
+
formatter: e = (u, c) => `${u}=${c}`,
|
|
18
|
+
keyMap: t,
|
|
19
|
+
joinWith: d = "/",
|
|
20
|
+
valueMap: r = {}
|
|
12
21
|
} = {}) {
|
|
13
|
-
const
|
|
14
|
-
return Object.keys(
|
|
15
|
-
typeof
|
|
16
|
-
}), (c = {}) => Object.entries(c).map(([
|
|
17
|
-
const
|
|
18
|
-
let
|
|
19
|
-
return typeof
|
|
20
|
-
}).join(
|
|
22
|
+
const u = typeof t == "function" ? t : j(t || {});
|
|
23
|
+
return Object.keys(r).forEach((c) => {
|
|
24
|
+
typeof r[c] != "function" && (r[c] = j(r[c]));
|
|
25
|
+
}), (c = {}) => Object.entries(c).map(([f, g]) => {
|
|
26
|
+
const p = r[f], l = u(f);
|
|
27
|
+
let v = g;
|
|
28
|
+
return typeof p == "function" && (v = p(c[f])), e(l, v);
|
|
29
|
+
}).join(d);
|
|
21
30
|
}
|
|
22
|
-
function
|
|
23
|
-
const
|
|
24
|
-
return
|
|
31
|
+
function T(e = "", t = []) {
|
|
32
|
+
const r = new URL(e).host;
|
|
33
|
+
return t.some((u) => u === r ? !0 : u.endsWith(`.${r}`));
|
|
25
34
|
}
|
|
26
|
-
const
|
|
35
|
+
const F = q.CLOUDINARY, H = (e) => e.startsWith("#") ? e.replace("#", "rgb_") : e, I = Q({
|
|
27
36
|
keyMap: {
|
|
28
37
|
fit: "c",
|
|
29
38
|
width: "w",
|
|
@@ -44,153 +53,125 @@ const q = B.CLOUDINARY, G = (t) => t.startsWith("#") ? t.replace("#", "rgb_") :
|
|
|
44
53
|
format: {
|
|
45
54
|
jpeg: "jpg"
|
|
46
55
|
},
|
|
47
|
-
background(
|
|
48
|
-
return
|
|
56
|
+
background(e) {
|
|
57
|
+
return H(e);
|
|
49
58
|
}
|
|
50
59
|
},
|
|
51
60
|
joinWith: ",",
|
|
52
|
-
formatter: (
|
|
53
|
-
}),
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
quality: "auto"
|
|
61
|
+
formatter: (e, t) => `${e}_${t}`
|
|
62
|
+
}), Y = {
|
|
63
|
+
format: "auto",
|
|
64
|
+
quality: "auto:best"
|
|
57
65
|
};
|
|
58
|
-
function
|
|
59
|
-
const
|
|
60
|
-
return `${
|
|
66
|
+
function Z(e, t = {}) {
|
|
67
|
+
const d = G(Y, t), r = I(d);
|
|
68
|
+
return `${F}/${r}/${e}`;
|
|
61
69
|
}
|
|
62
|
-
const
|
|
70
|
+
const J = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
63
71
|
__proto__: null,
|
|
64
|
-
getImageUrl:
|
|
65
|
-
operationsGenerator:
|
|
72
|
+
getImageUrl: Z,
|
|
73
|
+
operationsGenerator: I
|
|
66
74
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
67
|
-
function
|
|
68
|
-
return
|
|
75
|
+
function K(e = "") {
|
|
76
|
+
return e;
|
|
69
77
|
}
|
|
70
|
-
const
|
|
78
|
+
const X = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
71
79
|
__proto__: null,
|
|
72
|
-
getImageUrl:
|
|
73
|
-
}, Symbol.toStringTag, { value: "Module" })),
|
|
74
|
-
cloudinary:
|
|
75
|
-
static:
|
|
76
|
-
},
|
|
77
|
-
xsmall: {
|
|
78
|
-
alwaysIncluded: !1,
|
|
79
|
-
width: 160
|
|
80
|
-
},
|
|
81
|
-
small: {
|
|
82
|
-
alwaysIncluded: !0,
|
|
83
|
-
width: 338
|
|
84
|
-
},
|
|
85
|
-
medium: {
|
|
86
|
-
alwaysIncluded: !0,
|
|
87
|
-
width: 676
|
|
88
|
-
},
|
|
89
|
-
large: {
|
|
90
|
-
alwaysIncluded: !0,
|
|
91
|
-
width: 1352
|
|
92
|
-
},
|
|
93
|
-
xlarge: {
|
|
94
|
-
alwaysIncluded: !1,
|
|
95
|
-
width: 2704
|
|
96
|
-
}
|
|
97
|
-
};
|
|
98
|
-
var X = /* @__PURE__ */ ((t) => (t.None = "none", t.Rounded = "rounded", t))(X || {});
|
|
99
|
-
const ne = /* @__PURE__ */ x({
|
|
80
|
+
getImageUrl: K
|
|
81
|
+
}, Symbol.toStringTag, { value: "Module" })), tt = {
|
|
82
|
+
cloudinary: J,
|
|
83
|
+
static: X
|
|
84
|
+
}, et = ["src"], it = /* @__PURE__ */ M({
|
|
100
85
|
__name: "Image",
|
|
101
86
|
props: {
|
|
102
87
|
src: { default: "" },
|
|
103
|
-
srcset: { default:
|
|
104
|
-
sizes: { default:
|
|
88
|
+
srcset: { default: void 0 },
|
|
89
|
+
sizes: { default: void 0 },
|
|
105
90
|
provider: { default: void 0 },
|
|
106
|
-
radius: { default: "none" }
|
|
91
|
+
radius: { default: "none" },
|
|
92
|
+
staticPath: { default: void 0 }
|
|
107
93
|
},
|
|
108
|
-
setup(
|
|
109
|
-
const
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
},
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
}
|
|
116
|
-
|
|
117
|
-
return
|
|
118
|
-
}),
|
|
119
|
-
var r;
|
|
120
|
-
return ((r = n == null ? void 0 : n.images) == null ? void 0 : r.staticDomains) || [];
|
|
121
|
-
}), g = d(() => {
|
|
94
|
+
setup(e) {
|
|
95
|
+
const t = e, d = {
|
|
96
|
+
md: y.md,
|
|
97
|
+
lg: y.lg
|
|
98
|
+
}, r = B("stashOptions"), u = o(() => {
|
|
99
|
+
const { src: n, ...s } = D();
|
|
100
|
+
return s.sizes = U.value, s.srcset = E.value, s;
|
|
101
|
+
}), c = o(() => {
|
|
102
|
+
var n;
|
|
103
|
+
return ((n = r == null ? void 0 : r.images) == null ? void 0 : n.staticDomains) || [];
|
|
104
|
+
}), S = o(() => {
|
|
122
105
|
try {
|
|
123
|
-
new URL(
|
|
106
|
+
return new URL(t.src), !0;
|
|
124
107
|
} catch {
|
|
125
|
-
return !
|
|
108
|
+
return !1;
|
|
126
109
|
}
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
(
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
110
|
+
}), f = o(() => S.value && T(t.src, c.value)), g = o(() => {
|
|
111
|
+
var n;
|
|
112
|
+
return t.provider || ((n = r == null ? void 0 : r.images) == null ? void 0 : n.provider) || z.Static;
|
|
113
|
+
}), p = o(() => t.staticPath || (r == null ? void 0 : r.staticPath)), l = o(() => g.value === z.Static), v = o(() => tt[g.value]), $ = o(() => l.value ? _() : _({ width: w.md })), U = o(() => t.sizes ? x() : t.sizes), E = o(() => t.sizes && !t.srcset && !l.value ? W() : t.srcset), R = o(() => t.sizes ? A(t.sizes) : []);
|
|
114
|
+
function _(n = {}) {
|
|
115
|
+
if (l.value && S.value && !f.value)
|
|
116
|
+
return V.error(`Image: ${t.src} is not from a whitelisted domain. See \`stashOptions.image.domains\`.`), "";
|
|
117
|
+
if (l.value && f.value)
|
|
118
|
+
return t.src;
|
|
119
|
+
const s = l.value && p.value ? `${p.value}/${t.src}` : t.src;
|
|
120
|
+
return v.value.getImageUrl(s, n);
|
|
136
121
|
}
|
|
137
|
-
function
|
|
138
|
-
|
|
139
|
-
return Object.values(r).map((s) => {
|
|
140
|
-
const l = s.width;
|
|
141
|
-
return `${I({ width: l })} ${s.width}w`;
|
|
142
|
-
}).join(", ");
|
|
122
|
+
function W() {
|
|
123
|
+
return Object.values(w).map((n) => `${_({ width: n })} ${n}w`).join(", ");
|
|
143
124
|
}
|
|
144
|
-
function
|
|
145
|
-
|
|
125
|
+
function x() {
|
|
126
|
+
var n;
|
|
127
|
+
return (n = t.sizes) != null && n.includes("(") ? t.sizes : R.value.map((s) => `${s.mediaQuery ? s.mediaQuery + " " : ""}${s.size}`).join(", ");
|
|
146
128
|
}
|
|
147
|
-
function
|
|
148
|
-
const s = [],
|
|
129
|
+
function A(n = "") {
|
|
130
|
+
const s = [], h = {
|
|
149
131
|
default: "100vw"
|
|
150
132
|
};
|
|
151
|
-
if (typeof
|
|
152
|
-
const
|
|
153
|
-
for (const
|
|
154
|
-
const
|
|
155
|
-
if (
|
|
156
|
-
|
|
133
|
+
if (typeof n == "string") {
|
|
134
|
+
const m = n.split(/[\s]+/).filter((a) => a);
|
|
135
|
+
for (const a of m) {
|
|
136
|
+
const i = a.split(":");
|
|
137
|
+
if (i.length !== 2) {
|
|
138
|
+
h.default = i[0].trim();
|
|
157
139
|
continue;
|
|
158
140
|
}
|
|
159
|
-
|
|
141
|
+
h[i[0].trim()] = i[1].trim();
|
|
160
142
|
}
|
|
161
143
|
} else
|
|
162
144
|
throw new Error("`sizes` needs to be a string");
|
|
163
|
-
for (const
|
|
164
|
-
const
|
|
165
|
-
let
|
|
166
|
-
const b =
|
|
167
|
-
if (!b && /^\d+$/.test(
|
|
168
|
-
|
|
169
|
-
const
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
size: p
|
|
145
|
+
for (const m in h) {
|
|
146
|
+
const a = parseInt(d[m] || 0);
|
|
147
|
+
let i = String(h[m]);
|
|
148
|
+
const b = i.endsWith("vw");
|
|
149
|
+
if (!b && /^\d+$/.test(i) && (i = `${i}px`), !b && i.endsWith("%"))
|
|
150
|
+
throw new Error("Image: `sizes` does not support percentage values");
|
|
151
|
+
const O = {
|
|
152
|
+
mediaQuery: a ? `(min-width: ${a}px)` : "",
|
|
153
|
+
screenMinWidth: a,
|
|
154
|
+
size: i
|
|
174
155
|
};
|
|
175
|
-
s.push(
|
|
156
|
+
s.push(O);
|
|
176
157
|
}
|
|
177
|
-
return s.sort((
|
|
158
|
+
return s.sort((m, a) => m.screenMinWidth > a.screenMinWidth ? -1 : 1), s;
|
|
178
159
|
}
|
|
179
|
-
return (
|
|
160
|
+
return (n, s) => (L(), k("img", C({
|
|
180
161
|
ref: "img",
|
|
181
|
-
key:
|
|
162
|
+
key: $.value,
|
|
182
163
|
"data-test": "stash-image",
|
|
183
164
|
class: ["stash-image", {
|
|
184
|
-
"tw-rounded":
|
|
185
|
-
/* Rounded */
|
|
165
|
+
"tw-rounded": t.radius === N(P).Rounded
|
|
186
166
|
}],
|
|
187
|
-
src:
|
|
188
|
-
},
|
|
167
|
+
src: $.value
|
|
168
|
+
}, u.value), null, 16, et));
|
|
189
169
|
}
|
|
190
170
|
});
|
|
191
171
|
export {
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
172
|
+
z as ImageProviders,
|
|
173
|
+
P as ImageRadius,
|
|
174
|
+
w as Screens,
|
|
175
|
+
it as default
|
|
195
176
|
};
|
|
196
177
|
//# sourceMappingURL=Image.js.map
|
package/dist/Image.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Image.js","sources":["../src/components/Image/providers/utils.ts","../src/components/Image/providers/cloudinary.ts","../src/components/Image/providers/static.ts","../src/components/Image/providers/index.ts","../src/components/Image/Image.vue"],"sourcesContent":["export interface ImageModifiers {\n format?: string;\n height?: number;\n width?: number;\n [key: string]: any /* eslint-disable-line @typescript-eslint/no-explicit-any */;\n}\n\nexport type ParamFormatter = (key: string, value: string) => string;\n\nexport type ParamMapper = { [key: string]: string } | ((key: string) => string);\n\nexport interface ProviderUrlBuilder {\n keyMap?: ParamMapper;\n formatter?: ParamFormatter;\n joinWith?: string;\n valueMap?: {\n [key: string]: ParamMapper;\n };\n}\n\nfunction createMapper(map: ParamMapper) {\n return (key: string) => {\n return map[key] || key;\n };\n}\n\n/**\n * Builds the parameterized Cloudinary url\n */\nexport function buildProviderUrl({\n formatter = (key, value) => `${key}=${value}`,\n keyMap,\n joinWith = '/',\n valueMap = {},\n}: ProviderUrlBuilder = {}) {\n const keyMapper = typeof keyMap === 'function' ? keyMap : createMapper(keyMap || {});\n\n Object.keys(valueMap).forEach((valueKey) => {\n if (typeof valueMap[valueKey] !== 'function') {\n valueMap[valueKey] = createMapper(valueMap[valueKey]);\n }\n });\n\n return (modifiers: { [key: string]: string } = {}) => {\n const operations = Object.entries(modifiers).map(([key, value]) => {\n const mapper = valueMap[key];\n const newKey = keyMapper(key);\n let newVal = value;\n\n if (typeof mapper === 'function') {\n newVal = mapper(modifiers[key]);\n }\n\n return formatter(newKey, newVal);\n });\n\n return operations.join(joinWith);\n };\n}\n\n/**\n * Checks if a (sub)domain is included in a list of acceptable domains\n * @param str the (sub)domain to check\n * @param domains an array of valid domains\n */\nexport function isDomainValid(str = '', domains: string[] = []): boolean {\n const url = new URL(str);\n const host = url.host;\n\n return domains.some((domain) => {\n if (domain === host) {\n return true;\n }\n\n return domain.endsWith(`.${host}`);\n });\n}\n","import merge from 'lodash-es/merge';\n\nimport { IMAGE_PROVIDER_URLS } from '../../../constants';\nimport { buildProviderUrl, ImageModifiers } from './utils';\n\nconst BASE_URL = IMAGE_PROVIDER_URLS.CLOUDINARY;\n\nconst convertHextoRGBFormat = (value: string) => (value.startsWith('#') ? value.replace('#', 'rgb_') : value);\n\n/**\n * Parameters (option and value pairs) that can be used in the <transformations> segment of the Cloudinary transformation URL.\n * Options and their respective values are connected by an underscore (eg `w_250` for width of 250px.).\n * Multiple parameters are comma separated (eg. `w_250,h_250`).\n *\n * `keyMap` maps the option to its option prefix.\n * `valueMap` is used for grouping options using the same `keyMap` value under a 'category', allowing for easier usage and custom labelling in the component context.\n *\n * Transformation URL structure:\n * https://cloudinary.com/documentation/transformation_reference\n *\n * Transformation URL parameters (options and values):\n * https://cloudinary.com/documentation/image_transformations#transformation_url_syntax\n *\n */\nexport const operationsGenerator = buildProviderUrl({\n keyMap: {\n fit: 'c',\n width: 'w',\n height: 'h',\n format: 'f',\n quality: 'q',\n background: 'b',\n dpr: 'dpr',\n },\n valueMap: {\n fit: {\n fill: 'fill',\n inside: 'pad',\n outside: 'lpad',\n cover: 'fit',\n contain: 'scale',\n },\n format: {\n jpeg: 'jpg',\n },\n background(value: string) {\n return convertHextoRGBFormat(value);\n },\n },\n joinWith: ',',\n formatter: (key, value) => `${key}_${value}`,\n});\n\n// Note: Not configurable via Image props (for now).\nconst defaultModifiers = {\n // defaulting to maintain original image format to reduce transformations\n // format: 'auto',\n quality: 'auto',\n};\n\nexport function getImageUrl(src: string, modifiers: Partial<ImageModifiers> = {}): string {\n const mergeModifiers = merge(defaultModifiers, modifiers);\n const operations = operationsGenerator(mergeModifiers);\n\n return `${BASE_URL}/${operations}/${src}`;\n}\n","export function getImageUrl(src = ''): string {\n return src;\n}\n","import * as cloudinary from './cloudinary';\nimport * as staticProvider from './static';\n\nexport default {\n cloudinary,\n static: staticProvider,\n};\n","<script lang=\"ts\">\n export const PRESET_SIZES = {\n xsmall: {\n alwaysIncluded: false,\n width: 160,\n },\n small: {\n alwaysIncluded: true,\n width: 338,\n },\n medium: {\n alwaysIncluded: true,\n width: 676,\n },\n large: {\n alwaysIncluded: true,\n width: 1352,\n },\n xlarge: {\n alwaysIncluded: false,\n width: 2704,\n },\n } as const;\n\n export enum ImageRadiuses {\n None = 'none',\n Rounded = 'rounded',\n }\n</script>\n\n<script setup lang=\"ts\">\n import { computed, inject, useAttrs } from 'vue';\n\n import { StashImageProviders, StashProvideState } from '../../../types/misc';\n import { SCREEN_SIZES } from '../../constants';\n import providers from './providers';\n import { ImageModifiers, isDomainValid } from './providers/utils';\n\n // interface ImagePresetSizes {\n // [size: string]: {\n // alwaysIncluded: boolean;\n // width: number;\n // }\n // }\n\n export interface ImageSizeVariant {\n media: string;\n preset?: keyof typeof PRESET_SIZES;\n screenMinWidth: number;\n size: string;\n }\n\n export type ImageRadius = `${ImageRadiuses}`;\n\n export interface ImageProps {\n /**\n * The path to the image you want to embed.\n */\n src: string;\n\n /**\n * Native srcset attribute.\n * One or more strings separated by commas, indicating possible image sources\n * Can only be used with provider=static, otherwise it's ignored and auto-generated with `sizes` usage\n */\n srcset?: string;\n\n /**\n * For specifying responsive sizes\n */\n sizes?: string;\n\n /**\n * Where the image is served from.\n * Optional, and when provided it forces the provider used.\n *\n * The provider is otherwise inherited from the Stash config `stashOptions.images.provider`, which defaults to `cloudinary`.\n *\n * When not provided, the provider is also inferred by `isStatic`:\n * - `static` for relative/absolute paths (`img/foo.jpg` or `/static/img/bar.jpg`), or when whitelisted absolute URLs are used (included in `staticOptions.images.staticDomains`).\n */\n provider?: StashImageProviders;\n\n /**\n * For applying border radius\n */\n radius?: ImageRadius;\n\n /**\n * TODO - https://leaflink.atlassian.net/browse/GRO-204\n * A custom function used to resolve a URL string for the image\n */\n // loader?: () => string;\n }\n\n const PROVIDERS = {\n CLOUDINARY: 'cloudinary',\n STATIC: 'static',\n };\n const BREAKPOINTS = {\n md: SCREEN_SIZES.md,\n lg: SCREEN_SIZES.lg,\n };\n const stashOptions = inject<StashProvideState>('stashOptions');\n const props = withDefaults(defineProps<ImageProps>(), {\n src: '',\n srcset: '',\n sizes: '',\n provider: undefined,\n radius: 'none',\n // loader: undefined, // TODO - https://leaflink.atlassian.net/browse/GRO-204\n });\n\n const attrs = computed(() => {\n const { src, ...attrs } = useAttrs();\n\n attrs.sizes = imgSizes.value;\n attrs.srcset = imgSrcset.value;\n\n return attrs;\n });\n\n const staticDomains = computed(() => stashOptions?.images?.staticDomains || []);\n\n const isStaticUrl = computed(() => {\n // return true if not an absolute url\n try {\n new URL(props.src);\n } catch (e) {\n return true;\n }\n\n // true if domain is whitelisted for static usage\n return isDomainValid(props.src, staticDomains.value);\n });\n\n const computedProvider = computed(() => {\n if (props.provider) {\n return props.provider;\n }\n\n if (stashOptions?.images?.provider && stashOptions.images.provider !== PROVIDERS.STATIC && !isStaticUrl.value) {\n return stashOptions.images.provider;\n }\n\n return PROVIDERS.STATIC;\n });\n\n const isStatic = computed(() => computedProvider.value === PROVIDERS.STATIC);\n\n const imgProvider = computed(() => providers[computedProvider.value]);\n\n const imgSrc = computed(() =>\n isStatic.value ? getProviderImage() : getProviderImage({ width: PRESET_SIZES.medium.width }),\n );\n\n const imgSizes = computed(() => (props.sizes || !isStatic.value ? getSizes() : undefined));\n\n const imgSrcset = computed(() => (props.sizes && !props.srcset && !isStatic.value ? getSources() : props.srcset));\n\n const parsedSizes = computed(() => {\n if (props.sizes) {\n return parseSizes(props.sizes);\n }\n\n if (!isStatic.value) {\n return parseSizes('lg:large');\n }\n\n return [];\n });\n\n function getProviderImage(modifiers: ImageModifiers = {}) {\n return imgProvider.value.getImageUrl(props.src, modifiers);\n }\n\n function getSources() {\n const appliedPresets = Object.entries(PRESET_SIZES).reduce((obj, [key, entry]) => {\n const isPreset = !!parsedSizes.value.find((size) => size.preset === key);\n\n if (isPreset || entry.alwaysIncluded) {\n obj[key] = entry;\n }\n\n return obj;\n }, {} as typeof PRESET_SIZES);\n\n return Object.values(appliedPresets)\n .map((size) => {\n const width = size.width;\n const src = getProviderImage({ width });\n\n return `${src} ${size.width}w`;\n })\n .join(', ');\n }\n\n function getSizes() {\n return parsedSizes.value.map((v) => `${v.media ? v.media + ' ' : ''}${v.size}`).join(', ');\n }\n\n function parseSizes(providedSizes: string) {\n const variants: ImageSizeVariant[] = [];\n const sizes = {\n default: '100vw',\n };\n\n // parse sizes and convert to object\n if (typeof providedSizes === 'string') {\n const definitions = providedSizes.split(/[\\s]+/).filter((size) => size);\n\n for (const entry of definitions) {\n const size = entry.split(':');\n\n if (size.length !== 2) {\n sizes['default'] = size[0].trim();\n continue;\n }\n\n sizes[size[0].trim()] = size[1].trim();\n }\n } else {\n throw new Error('`sizes` needs to be a string');\n }\n\n for (const key in sizes) {\n const screenMinWidth = parseInt(BREAKPOINTS[key] || 0);\n const sizeValue = sizes[key];\n const presetKey = PRESET_SIZES[sizeValue] ? sizeValue : undefined;\n let size = String(presetKey ? PRESET_SIZES[sizeValue].width : sizeValue);\n const isFluid = size.endsWith('vw');\n\n // default integers to pixels\n if (!isFluid && /^\\d+$/.test(size)) {\n size = `${size}px`;\n }\n\n // ignore invalid size\n if (!isFluid && !size.endsWith('px')) {\n continue;\n }\n\n const variant = {\n media: screenMinWidth ? `(min-width: ${screenMinWidth}px)` : '',\n preset: presetKey,\n screenMinWidth,\n size,\n };\n\n variants.push(variant);\n }\n\n variants.sort((v1, v2) => (v1.screenMinWidth > v2.screenMinWidth ? -1 : 1));\n\n return variants;\n }\n</script>\n\n<template>\n <img\n ref=\"img\"\n :key=\"imgSrc\"\n data-test=\"stash-image\"\n class=\"stash-image\"\n :class=\"{\n 'tw-rounded': props.radius === ImageRadiuses.Rounded,\n }\"\n :src=\"imgSrc\"\n v-bind=\"attrs\"\n />\n</template>\n"],"names":["createMapper","map","key","buildProviderUrl","formatter","value","keyMap","joinWith","valueMap","keyMapper","valueKey","modifiers","mapper","newKey","newVal","isDomainValid","str","domains","host","domain","BASE_URL","IMAGE_PROVIDER_URLS","convertHextoRGBFormat","operationsGenerator","defaultModifiers","getImageUrl","src","mergeModifiers","merge","operations","providers","cloudinary","staticProvider","PRESET_SIZES","ImageRadiuses","PROVIDERS","BREAKPOINTS","SCREEN_SIZES","stashOptions","inject","attrs","computed","useAttrs","imgSizes","imgSrcset","staticDomains","_a","isStaticUrl","props","computedProvider","isStatic","imgProvider","imgSrc","getProviderImage","getSizes","getSources","parsedSizes","parseSizes","appliedPresets","obj","entry","size","width","v","providedSizes","variants","sizes","definitions","screenMinWidth","sizeValue","presetKey","isFluid","variant","v1","v2"],"mappings":";;;AAoBA,SAASA,EAAaC,GAAkB;AACtC,SAAO,CAACC,MACCD,EAAIC,CAAG,KAAKA;AAEvB;AAKO,SAASC,EAAiB;AAAA,EAC/B,WAAAC,IAAY,CAACF,GAAKG,MAAU,GAAGH,CAAG,IAAIG,CAAK;AAAA,EAC3C,QAAAC;AAAA,E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BoE,IAAYrC,EAAaoC,CAAS,IAAIA,IAAY;AACxD,YAAIR,IAAO,OAAOS,IAAYrC,EAAaoC,CAAS,EAAE,QAAQA,CAAS;AACjE,cAAAE,IAAUV,EAAK,SAAS,IAAI;AAQlC,YALI,CAACU,KAAW,QAAQ,KAAKV,CAAI,MAC/BA,IAAO,GAAGA,CAAI,OAIZ,CAACU,KAAW,CAACV,EAAK,SAAS,IAAI;AACjC;AAGF,cAAMW,IAAU;AAAA,UACd,OAAOJ,IAAiB,eAAeA,CAAc,QAAQ;AAAA,UAC7D,QAAQE;AAAA,UACR,gBAAAF;AAAA,UACA,MAAAP;AAAA,QAAA;AAGF,QAAAI,EAAS,KAAKO,CAAO;AAAA,MACvB;AAES,aAAAP,EAAA,KAAK,CAACQ,GAAIC,MAAQD,EAAG,iBAAiBC,EAAG,iBAAiB,KAAK,CAAE,GAEnET;AAAA,IACT;;;;;;;;;;;;;"}
|
|
1
|
+
{"version":3,"file":"Image.js","sources":["../src/components/Image/Image.types.ts","../src/components/Image/providers/utils.ts","../src/components/Image/providers/cloudinary.ts","../src/components/Image/providers/static.ts","../src/components/Image/providers/index.ts","../src/components/Image/Image.vue"],"sourcesContent":["// Sizes used to generate resized and optimized versions of an image.\n// Generated in `srcset`, and informed by `sizes`.\nexport const Screens = {\n xs: 160,\n sm: 338,\n md: 676,\n lg: 1352,\n xl: 2704,\n} as const;\n\nexport interface ImageSizeCondition {\n mediaQuery: string;\n screenMinWidth: number;\n size: string;\n}\n\nexport enum ImageRadius {\n None = 'none',\n Rounded = 'rounded',\n}\n\nexport type ImageRadii = `${ImageRadius}`;\n\nexport enum ImageProviders {\n Cloudinary = 'cloudinary',\n Static = 'static',\n}\n","export interface ImageModifiers {\n format?: string;\n height?: number;\n width?: number;\n [key: string]: any /* eslint-disable-line @typescript-eslint/no-explicit-any */;\n}\n\nexport type ParamFormatter = (key: string, value: string) => string;\n\nexport type ParamMapper = { [key: string]: string } | ((key: string) => string);\n\nexport interface ProviderUrlBuilder {\n keyMap?: ParamMapper;\n formatter?: ParamFormatter;\n joinWith?: string;\n valueMap?: {\n [key: string]: ParamMapper;\n };\n}\n\nfunction createMapper(map: ParamMapper) {\n return (key: string) => {\n return map[key] || key;\n };\n}\n\n/**\n * Builds the parameterized Cloudinary url\n */\nexport function buildProviderUrl({\n formatter = (key, value) => `${key}=${value}`,\n keyMap,\n joinWith = '/',\n valueMap = {},\n}: ProviderUrlBuilder = {}) {\n const keyMapper = typeof keyMap === 'function' ? keyMap : createMapper(keyMap || {});\n\n Object.keys(valueMap).forEach((valueKey) => {\n if (typeof valueMap[valueKey] !== 'function') {\n valueMap[valueKey] = createMapper(valueMap[valueKey]);\n }\n });\n\n return (modifiers: { [key: string]: string } = {}) => {\n const operations = Object.entries(modifiers).map(([key, value]) => {\n const mapper = valueMap[key];\n const newKey = keyMapper(key);\n let newVal = value;\n\n if (typeof mapper === 'function') {\n newVal = mapper(modifiers[key]);\n }\n\n return formatter(newKey, newVal);\n });\n\n return operations.join(joinWith);\n };\n}\n\n/**\n * Checks if a (sub)domain is included in a list of acceptable domains\n * @param str the (sub)domain to check\n * @param domains an array of valid domains\n */\nexport function isDomainValid(str = '', domains: string[] = []): boolean {\n const url = new URL(str);\n const host = url.host;\n\n return domains.some((domain) => {\n if (domain === host) {\n return true;\n }\n\n return domain.endsWith(`.${host}`);\n });\n}\n","import merge from 'lodash-es/merge';\n\nimport { IMAGE_PROVIDER_URLS } from '../../../constants';\nimport { buildProviderUrl, ImageModifiers } from './utils';\n\nconst BASE_URL = IMAGE_PROVIDER_URLS.CLOUDINARY;\n\nconst convertHextoRGBFormat = (value: string) => (value.startsWith('#') ? value.replace('#', 'rgb_') : value);\n\n/**\n * Parameters (option and value pairs) that can be used in the <transformations> segment of the Cloudinary transformation URL.\n * Options and their respective values are connected by an underscore (eg `w_250` for width of 250px.).\n * Multiple parameters are comma separated (eg. `w_250,h_250`).\n *\n * `keyMap` maps the option to its option prefix.\n * `valueMap` is used for grouping options using the same `keyMap` value under a 'category', allowing for easier usage and custom labelling in the component context.\n *\n * Transformation URL structure:\n * https://cloudinary.com/documentation/transformation_reference\n *\n * Transformation URL parameters (options and values):\n * https://cloudinary.com/documentation/image_transformations#transformation_url_syntax\n *\n */\nexport const operationsGenerator = buildProviderUrl({\n keyMap: {\n fit: 'c',\n width: 'w',\n height: 'h',\n format: 'f',\n quality: 'q',\n background: 'b',\n dpr: 'dpr',\n },\n valueMap: {\n fit: {\n fill: 'fill',\n inside: 'pad',\n outside: 'lpad',\n cover: 'fit',\n contain: 'scale',\n },\n format: {\n jpeg: 'jpg',\n },\n background(value: string) {\n return convertHextoRGBFormat(value);\n },\n },\n joinWith: ',',\n formatter: (key, value) => `${key}_${value}`,\n});\n\n// Note: Not configurable via Image props (for now).\nconst defaultModifiers = {\n format: 'auto',\n quality: 'auto:best',\n};\n\nexport function getImageUrl(src: string, modifiers: Partial<ImageModifiers> = {}): string {\n const mergeModifiers = merge(defaultModifiers, modifiers);\n const operations = operationsGenerator(mergeModifiers);\n\n return `${BASE_URL}/${operations}/${src}`;\n}\n","export function getImageUrl(src = ''): string {\n return src;\n}\n","import * as cloudinary from './cloudinary';\nimport * as staticProvider from './static';\n\nexport default {\n cloudinary,\n static: staticProvider,\n};\n","<script lang=\"ts\">\n export * from './Image.types';\n</script>\n\n<script setup lang=\"ts\">\n import logger from '@leaflink/snitch';\n import { computed, inject, useAttrs } from 'vue';\n\n import { StashImageProviders, StashProvideState } from '../../../types/misc';\n import { SCREEN_SIZES } from '../../constants';\n import { ImageProviders, ImageRadii, ImageRadius, ImageSizeCondition, Screens } from './Image.types';\n import providers from './providers';\n import { ImageModifiers, isDomainValid } from './providers/utils';\n\n export interface ImageProps {\n /**\n * The path to the image you want to embed.\n */\n src: string;\n\n /**\n * Native srcset attribute.\n * One or more strings separated by commas, indicating possible image sources\n * Can only be used with provider=static, otherwise it's ignored and auto-generated with `sizes` usage\n */\n srcset?: string;\n\n /**\n * For specifying responsive sizes\n */\n sizes?: string;\n\n /**\n * Where the image is served from.\n * Optional, and when provided it forces the provider used.\n *\n * The provider is otherwise inherited from the Stash config `stashOptions.images.provider`, which defaults to `cloudinary`.\n *\n * When not provided, the provider is also inferred by `isStatic`:\n * - `static` for relative/absolute paths (`img/foo.jpg` or `/static/img/bar.jpg`), or when whitelisted absolute URLs are used (included in `staticOptions.images.staticDomains`).\n */\n provider?: StashImageProviders;\n\n /**\n * For applying border radius\n */\n radius?: ImageRadii;\n\n /**\n * A custom static path the image src will be appended onto when provider=static.\n * Can be used to override the library-level default.\n */\n staticPath?: string;\n\n /**\n * TODO - https://leaflink.atlassian.net/browse/GRO-204\n * A custom function used to resolve a URL string for the image\n */\n // loader?: () => string;\n }\n\n const BREAKPOINTS = {\n md: SCREEN_SIZES.md,\n lg: SCREEN_SIZES.lg,\n };\n const stashOptions = inject<StashProvideState>('stashOptions');\n const props = withDefaults(defineProps<ImageProps>(), {\n src: '',\n srcset: undefined,\n sizes: undefined,\n staticPath: undefined,\n provider: undefined,\n radius: 'none',\n // loader: undefined, // TODO - https://leaflink.atlassian.net/browse/GRO-204\n });\n\n const attrs = computed(() => {\n const { src, ...attrs } = useAttrs();\n\n attrs.sizes = imgSizes.value;\n attrs.srcset = imgSrcset.value;\n\n return attrs;\n });\n\n const staticDomains = computed(() => stashOptions?.images?.staticDomains || []);\n\n const isAbsoluteUrl = computed(() => {\n // return true if not an absolute url\n try {\n new URL(props.src);\n return true;\n } catch (e) {\n return false;\n }\n });\n\n const isValidStaticAbsoluteUrl = computed(() => {\n return isAbsoluteUrl.value && isDomainValid(props.src, staticDomains.value);\n });\n\n const computedProvider = computed(() => props.provider || stashOptions?.images?.provider || ImageProviders.Static);\n\n const computedStaticPath = computed(() => props.staticPath || stashOptions?.staticPath);\n\n const isStatic = computed(() => computedProvider.value === ImageProviders.Static);\n\n const imgProvider = computed(() => providers[computedProvider.value]);\n\n const imgSrc = computed(() => (isStatic.value ? getProviderImage() : getProviderImage({ width: Screens.md })));\n\n const imgSizes = computed(() => (props.sizes ? getSizes() : props.sizes));\n\n const imgSrcset = computed(() => (props.sizes && !props.srcset && !isStatic.value ? getSources() : props.srcset));\n\n const parsedSizes = computed(() => {\n return props.sizes ? parseSizes(props.sizes) : [];\n });\n\n function getProviderImage(modifiers: ImageModifiers = {}) {\n if (isStatic.value && isAbsoluteUrl.value && !isValidStaticAbsoluteUrl.value) {\n // eslint-disable-next-line no-console\n logger.error(`Image: ${props.src} is not from a whitelisted domain. See \\`stashOptions.image.domains\\`.`);\n return '';\n }\n\n if (isStatic.value && isValidStaticAbsoluteUrl.value) {\n return props.src;\n }\n\n const src = isStatic.value && computedStaticPath.value ? `${computedStaticPath.value}/${props.src}` : props.src;\n\n return imgProvider.value.getImageUrl(src, modifiers);\n }\n\n function getSources() {\n return Object.values(Screens)\n .map((width) => {\n const src = getProviderImage({ width });\n\n return `${src} ${width}w`;\n })\n .join(', ');\n }\n\n function getSizes() {\n // return if using native media conditions\n if (props.sizes?.includes('(')) {\n return props.sizes;\n }\n\n return parsedSizes.value.map((v) => `${v.mediaQuery ? v.mediaQuery + ' ' : ''}${v.size}`).join(', ');\n }\n\n function parseSizes(providedSizes = '') {\n const conditions: ImageSizeCondition[] = [];\n const sizes = {\n default: '100vw',\n };\n\n // parse sizes and convert to object\n if (typeof providedSizes === 'string') {\n const definitions = providedSizes.split(/[\\s]+/).filter((size) => size);\n\n for (const entry of definitions) {\n const size = entry.split(':');\n\n if (size.length !== 2) {\n sizes['default'] = size[0].trim();\n continue;\n }\n\n sizes[size[0].trim()] = size[1].trim();\n }\n } else {\n throw new Error('`sizes` needs to be a string');\n }\n\n for (const key in sizes) {\n const screenMinWidth = parseInt(BREAKPOINTS[key] || 0);\n let size = String(sizes[key]);\n const isFluidSize = size.endsWith('vw');\n\n // convert integer to pixels\n if (!isFluidSize && /^\\d+$/.test(size)) {\n size = `${size}px`;\n }\n\n if (!isFluidSize && size.endsWith('%')) {\n throw new Error('Image: `sizes` does not support percentage values');\n }\n\n const condition = {\n mediaQuery: screenMinWidth ? `(min-width: ${screenMinWidth}px)` : '',\n screenMinWidth,\n size,\n };\n\n conditions.push(condition);\n }\n\n conditions.sort((v1, v2) => (v1.screenMinWidth > v2.screenMinWidth ? -1 : 1));\n\n return conditions;\n }\n</script>\n\n<template>\n <img\n ref=\"img\"\n :key=\"imgSrc\"\n data-test=\"stash-image\"\n class=\"stash-image\"\n :class=\"{\n 'tw-rounded': props.radius === ImageRadius.Rounded,\n }\"\n :src=\"imgSrc\"\n v-bind=\"attrs\"\n />\n</template>\n"],"names":["Screens","ImageRadius","ImageProviders","createMapper","map","key","buildProviderUrl","formatter","value","keyMap","joinWith","valueMap","keyMapper","valueKey","modifiers","mapper","newKey","newVal","isDomainValid","str","domains","host","domain","BASE_URL","IMAGE_PROVIDER_URLS","convertHextoRGBFormat","operationsGenerator","defaultModifiers","getImageUrl","src","mergeModifiers","merge","operations","providers","cloudinary","staticProvider","BREAKPOINTS","SCREEN_SIZES","stashOptions","inject","attrs","computed","useAttrs","imgSizes","imgSrcset","staticDomains","_a","isAbsoluteUrl","props","isValidStaticAbsoluteUrl","computedProvider","computedStaticPath","isStatic","imgProvider","imgSrc","getProviderImage","getSizes","getSources","parsedSizes","parseSizes","logger","width","v","providedSizes","conditions","sizes","definitions","size","entry","screenMinWidth","isFluidSize","condition","v1","v2"],"mappings":";;;;AAEO,MAAMA,IAAU;AAAA,EACrB,IAAI;AAAA,EACJ,IAAI;AAAA,EACJ,IAAI;AAAA,EACJ,IAAI;AAAA,EACJ,IAAI;AACN;AAQY,IAAAC,sBAAAA,OACVA,EAAA,OAAO,QACPA,EAAA,UAAU,WAFAA,IAAAA,KAAA,CAAA,CAAA,GAOAC,sBAAAA,OACVA,EAAA,aAAa,cACbA,EAAA,SAAS,UAFCA,IAAAA,KAAA,CAAA,CAAA;ACHZ,SAASC,EAAaC,GAAkB;AACtC,SAAO,CAACC,MACCD,EAAIC,CAAG,KAAKA;AAEvB;AAKO,SAASC,EAAiB;AAAA,E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EAAA,KAAK,CAACQ,GAAIC,MAAQD,EAAG,iBAAiBC,EAAG,iBAAiB,KAAK,CAAE,GAErET;AAAA,IACT;;;;;;;;;;;;"}
|
package/dist/Image.vue.d.ts
CHANGED
|
@@ -29,17 +29,20 @@ declare type __VLS_WithDefaults<P, D> = {
|
|
|
29
29
|
|
|
30
30
|
declare const _default: DefineComponent<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<ImageProps>, {
|
|
31
31
|
src: string;
|
|
32
|
-
srcset:
|
|
33
|
-
sizes:
|
|
32
|
+
srcset: undefined;
|
|
33
|
+
sizes: undefined;
|
|
34
|
+
staticPath: undefined;
|
|
34
35
|
provider: undefined;
|
|
35
36
|
radius: string;
|
|
36
37
|
}>, {}, unknown, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, VNodeProps & AllowedComponentProps & ComponentCustomProps, Readonly<ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<ImageProps>, {
|
|
37
38
|
src: string;
|
|
38
|
-
srcset:
|
|
39
|
-
sizes:
|
|
39
|
+
srcset: undefined;
|
|
40
|
+
sizes: undefined;
|
|
41
|
+
staticPath: undefined;
|
|
40
42
|
provider: undefined;
|
|
41
43
|
radius: string;
|
|
42
44
|
}>>>, {
|
|
45
|
+
staticPath: string;
|
|
43
46
|
src: string;
|
|
44
47
|
radius: "none" | "rounded";
|
|
45
48
|
srcset: string;
|
|
@@ -76,44 +79,38 @@ export declare interface ImageProps {
|
|
|
76
79
|
/**
|
|
77
80
|
* For applying border radius
|
|
78
81
|
*/
|
|
79
|
-
radius?:
|
|
82
|
+
radius?: ImageRadii;
|
|
83
|
+
/**
|
|
84
|
+
* A custom static path the image src will be appended onto when provider=static.
|
|
85
|
+
* Can be used to override the library-level default.
|
|
86
|
+
*/
|
|
87
|
+
staticPath?: string;
|
|
80
88
|
}
|
|
81
89
|
|
|
82
|
-
export declare
|
|
90
|
+
export declare enum ImageProviders {
|
|
91
|
+
Cloudinary = "cloudinary",
|
|
92
|
+
Static = "static"
|
|
93
|
+
}
|
|
83
94
|
|
|
84
|
-
export declare
|
|
95
|
+
export declare type ImageRadii = `${ImageRadius}`;
|
|
96
|
+
|
|
97
|
+
export declare enum ImageRadius {
|
|
85
98
|
None = "none",
|
|
86
99
|
Rounded = "rounded"
|
|
87
100
|
}
|
|
88
101
|
|
|
89
|
-
export declare interface
|
|
90
|
-
|
|
91
|
-
preset?: keyof typeof PRESET_SIZES;
|
|
102
|
+
export declare interface ImageSizeCondition {
|
|
103
|
+
mediaQuery: string;
|
|
92
104
|
screenMinWidth: number;
|
|
93
105
|
size: string;
|
|
94
106
|
}
|
|
95
107
|
|
|
96
|
-
export declare const
|
|
97
|
-
readonly
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
readonly
|
|
102
|
-
readonly alwaysIncluded: true;
|
|
103
|
-
readonly width: 338;
|
|
104
|
-
};
|
|
105
|
-
readonly medium: {
|
|
106
|
-
readonly alwaysIncluded: true;
|
|
107
|
-
readonly width: 676;
|
|
108
|
-
};
|
|
109
|
-
readonly large: {
|
|
110
|
-
readonly alwaysIncluded: true;
|
|
111
|
-
readonly width: 1352;
|
|
112
|
-
};
|
|
113
|
-
readonly xlarge: {
|
|
114
|
-
readonly alwaysIncluded: false;
|
|
115
|
-
readonly width: 2704;
|
|
116
|
-
};
|
|
108
|
+
export declare const Screens: {
|
|
109
|
+
readonly xs: 160;
|
|
110
|
+
readonly sm: 338;
|
|
111
|
+
readonly md: 676;
|
|
112
|
+
readonly lg: 1352;
|
|
113
|
+
readonly xl: 2704;
|
|
117
114
|
};
|
|
118
115
|
|
|
119
116
|
declare enum StashImageProvider {
|
package/dist/index.js
CHANGED
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../node_modules/vue3-touch-events/index.js","../src/utils/Deferred.ts","../src/composables/useDialog/useDialog.ts","../src/components/Dialogs/Dialogs.vue","../src/plugins/DialogsPlugin.ts","../types/colors.ts","../src/index.ts"],"sourcesContent":["/**\r\n * @project vue3-touch-events\r\n * @author Robin Rodricks, Xavier Julien, Jerry Bendy\r\n * @since 30/4/2021\r\n * @url https://github.com/robinrodricks/vue3-touch-events\r\n */\r\n\r\nfunction touchX(event) {\r\n if(event.type.indexOf('mouse') !== -1){\r\n return event.clientX;\r\n }\r\n return event.touches[0].clientX;\r\n}\r\n\r\nfunction touchY(event) {\r\n if(event.type.indexOf('mouse') !== -1){\r\n return event.clientY;\r\n }\r\n return event.touches[0].clientY;\r\n}\r\n\r\nvar isPassiveSupported = (function() {\r\n var supportsPassive = false;\r\n try {\r\n var opts = Object.defineProperty({}, 'passive', {\r\n get: function() {\r\n supportsPassive = true;\r\n }\r\n });\r\n window.addEventListener('test', null, opts);\r\n } catch (e) {}\r\n return supportsPassive;\r\n})();\r\n\r\nvar vueTouchEvents = {\r\n install: function (app, constructorOptions) {\r\n\t\t\r\n var globalOptions = Object.assign({}, {\r\n disableClick: false,\r\n tapTolerance: 10, // px\r\n swipeTolerance: 30, // px\r\n touchHoldTolerance: 400, // ms\r\n longTapTimeInterval: 400, // ms\r\n touchClass: '',\r\n\t\t\tdragFrequency: 100, // ms\r\n\t\t\trollOverFrequency: 100, // ms\r\n }, constructorOptions);\r\n\r\n function touchStartEvent(event) {\r\n var $this = this.$$touchObj,\r\n isTouchEvent = event.type.indexOf('touch') >= 0,\r\n isMouseEvent = event.type.indexOf('mouse') >= 0,\r\n $el = this;\r\n\r\n if (isTouchEvent) {\r\n $this.lastTouchStartTime = event.timeStamp;\r\n }\r\n\r\n if (isMouseEvent && $this.lastTouchStartTime && event.timeStamp - $this.lastTouchStartTime < 350) {\r\n return;\r\n }\r\n\r\n if ($this.touchStarted) {\r\n return;\r\n }\r\n\r\n addTouchClass(this);\r\n\r\n $this.touchStarted = true; // always true while the element is being PRESSED\r\n\r\n $this.touchMoved = false; // true only when the element is PRESSED and DRAGGED a bit\r\n $this.swipeOutBounded = false;\r\n\r\n $this.startX = touchX(event);\r\n $this.startY = touchY(event);\r\n\r\n $this.currentX = 0; // always updated with the last mouse X/Y while over the element\r\n $this.currentY = 0;\r\n\r\n $this.touchStartTime = event.timeStamp;\r\n\t\t\t\r\n\t\t\t// performance: only process swipe events if `swipe.*` event is registered on this element\r\n\t\t\t$this.hasSwipe = hasEvent(this, 'swipe')\r\n\t\t\t\t|| hasEvent(this, 'swipe.left') || hasEvent(this, 'swipe.right')\r\n\t\t\t\t|| hasEvent(this, 'swipe.top') || hasEvent(this, 'swipe.bottom');\r\n\r\n\t\t\t// performance: only start hold timer if the `hold` event is registered on this element\r\n\t\t\tif (hasEvent(this, 'hold')){\r\n\t\t\t\t\r\n\t\t\t\t// Trigger touchhold event after `touchHoldTolerance` MS\r\n\t\t\t\t$this.touchHoldTimer = setTimeout(function() {\r\n\t\t\t\t\t$this.touchHoldTimer = null;\r\n\t\t\t\t\ttriggerEvent(event, $el, 'hold');\r\n\t\t\t\t}, $this.options.touchHoldTolerance);\r\n\t\t\t}\r\n\t\t\t\r\n triggerEvent(event, this, 'press');\r\n }\r\n\r\n function touchMoveEvent(event) {\r\n var $this = this.$$touchObj;\r\n\t\t\t\r\n\t\t\tvar curX = touchX(event);\r\n\t\t\tvar curY = touchY(event);\r\n\r\n\t\t\tvar movedAgain = ($this.currentX != curX) || ($this.currentY != curY);\r\n\t\t\t\r\n $this.currentX = curX;\r\n $this.currentY = curY;\r\n\r\n if (!$this.touchMoved) {\r\n var tapTolerance = $this.options.tapTolerance;\r\n\r\n $this.touchMoved = Math.abs($this.startX - $this.currentX) > tapTolerance ||\r\n\t\t\t\t\t\t\t\t Math.abs($this.startY - $this.currentY) > tapTolerance;\r\n\r\n\t\t\t\t// trigger `drag.once` only once after mouse FIRST moved while dragging the element\r\n\t\t\t\t// (`touchMoved` is the flag that indicates we no longer need to trigger this)\r\n if($this.touchMoved){\r\n cancelTouchHoldTimer($this);\r\n triggerEvent(event, this, 'drag.once');\r\n }\r\n\r\n\t\t\t// performance: only process swipe events if `swipe.*` event is registered on this element\r\n } else if ($this.hasSwipe && !$this.swipeOutBounded) {\r\n\t\t\t\tvar swipeOutBounded = $this.options.swipeTolerance;\r\n\r\n\t\t\t\t$this.swipeOutBounded = Math.abs($this.startX - $this.currentX) > swipeOutBounded &&\r\n\t\t\t\t\tMath.abs($this.startY - $this.currentY) > swipeOutBounded;\r\n }\r\n\r\n\t\t\t// only trigger `rollover` event if cursor actually moved over this element\r\n if(hasEvent(this, 'rollover') && movedAgain){\r\n\t\t\t\t\r\n\t\t\t\t// throttle the `rollover` event based on `rollOverFrequency`\r\n\t\t\t\tvar now = event.timeStamp;\r\n\t\t\t\tvar throttle = $this.options.rollOverFrequency;\r\n\t\t\t\tif ($this.touchRollTime == null || now > ($this.touchRollTime + throttle)){\r\n\t\t\t\t\t$this.touchRollTime = now;\r\n\t\t\t\t\t\r\n\t\t\t\t\ttriggerEvent(event, this, 'rollover');\r\n\t\t\t\t}\r\n }\r\n\r\n\t\t\t// only trigger `drag` event if cursor actually moved and if we are still dragging this element\r\n if(hasEvent(this, 'drag') && $this.touchStarted && $this.touchMoved && movedAgain){\r\n\t\t\t\t\r\n\t\t\t\t// throttle the `drag` event based on `dragFrequency`\r\n\t\t\t\tvar now = event.timeStamp;\r\n\t\t\t\tvar throttle = $this.options.dragFrequency;\r\n\t\t\t\tif ($this.touchDragTime == null || now > ($this.touchDragTime + throttle)){\r\n\t\t\t\t\t$this.touchDragTime = now;\r\n\t\t\t\t\t\r\n\t\t\t\t\ttriggerEvent(event, this, 'drag');\r\n\t\t\t\t}\r\n }\r\n }\r\n\r\n function touchCancelEvent() {\r\n var $this = this.$$touchObj;\r\n\r\n cancelTouchHoldTimer($this);\r\n removeTouchClass(this);\r\n\r\n $this.touchStarted = $this.touchMoved = false;\r\n $this.startX = $this.startY = 0;\r\n }\r\n\r\n function touchEndEvent(event) {\r\n var $this = this.$$touchObj,\r\n isTouchEvent = event.type.indexOf('touch') >= 0,\r\n isMouseEvent = event.type.indexOf('mouse') >= 0;\r\n\r\n if (isTouchEvent) {\r\n $this.lastTouchEndTime = event.timeStamp;\r\n }\r\n\r\n var touchholdEnd = isTouchEvent && !$this.touchHoldTimer;\r\n cancelTouchHoldTimer($this);\r\n\r\n $this.touchStarted = false;\r\n\r\n removeTouchClass(this);\r\n\r\n if (isMouseEvent && $this.lastTouchEndTime && event.timeStamp - $this.lastTouchEndTime < 350) {\r\n return;\r\n }\r\n\r\n // trigger `end` event when touch stopped\r\n triggerEvent(event, this, 'release');\r\n\r\n if (!$this.touchMoved) {\r\n // detect if this is a longTap event or not\r\n if (hasEvent(this, 'longtap') && event.timeStamp - $this.touchStartTime > $this.options.longTapTimeInterval) {\r\n if (event.cancelable) {\r\n event.preventDefault();\r\n }\r\n triggerEvent(event, this, 'longtap');\r\n\r\n } else if (hasEvent(this, 'hold') && touchholdEnd) {\r\n if (event.cancelable) {\r\n event.preventDefault();\r\n }\r\n return;\r\n } else {\r\n // emit tap event\r\n triggerEvent(event, this, 'tap');\r\n }\r\n\r\n\t\t\t// performance: only process swipe events if `swipe.*` event is registered on this element\r\n } else if ($this.hasSwipe && !$this.swipeOutBounded) {\r\n var swipeOutBounded = $this.options.swipeTolerance,\r\n direction,\r\n distanceY = Math.abs($this.startY - $this.currentY),\r\n distanceX = Math.abs($this.startX - $this.currentX);\r\n\r\n if (distanceY > swipeOutBounded || distanceX > swipeOutBounded) {\r\n if (distanceY > swipeOutBounded) {\r\n direction = $this.startY > $this.currentY ? 'top' : 'bottom';\r\n } else {\r\n direction = $this.startX > $this.currentX ? 'left' : 'right';\r\n }\r\n\r\n // Only emit the specified event when it has modifiers\r\n if (hasEvent(this, 'swipe.' + direction)) {\r\n triggerEvent(event, this, 'swipe.' + direction, direction);\r\n } else {\r\n // Emit a common event when it has no any modifier\r\n triggerEvent(event, this, 'swipe', direction);\r\n }\r\n }\r\n }\r\n }\r\n\r\n function mouseEnterEvent() {\r\n addTouchClass(this);\r\n }\r\n\r\n function mouseLeaveEvent() {\r\n removeTouchClass(this);\r\n }\r\n\r\n function hasEvent($el, eventType) {\r\n var callbacks = $el.$$touchObj.callbacks[eventType];\r\n\t\t\treturn (callbacks != null && callbacks.length > 0);\r\n\t\t}\r\n\t\t\r\n function triggerEvent(e, $el, eventType, param) {\r\n var $this = $el.$$touchObj;\r\n\r\n // get the subscribers for this event\r\n var callbacks = $this.callbacks[eventType];\r\n\t\t\t\r\n\t\t\t// exit if no subscribers to this particular event\r\n if (callbacks == null || callbacks.length === 0) {\r\n return null;\r\n }\r\n\r\n\t\t\t// per callback\r\n for (var i = 0; i < callbacks.length; i++) {\r\n var binding = callbacks[i];\r\n\r\n if (binding.modifiers.stop) {\r\n e.stopPropagation();\r\n }\r\n\r\n if (binding.modifiers.prevent) {\r\n e.preventDefault();\r\n }\r\n\r\n // handle `self` modifier`\r\n if (binding.modifiers.self && e.target !== e.currentTarget) {\r\n continue;\r\n }\r\n\r\n if (typeof binding.value === 'function') {\r\n if (param) {\r\n binding.value(param, e);\r\n } else {\r\n binding.value(e);\r\n }\r\n }\r\n }\r\n }\r\n\r\n function addTouchClass($el) {\r\n var className = $el.$$touchObj.options.touchClass;\r\n className && $el.classList.add(className);\r\n }\r\n\r\n function removeTouchClass($el) {\r\n var className = $el.$$touchObj.options.touchClass;\r\n className && $el.classList.remove(className);\r\n }\r\n\r\n function cancelTouchHoldTimer($this) {\r\n if ($this.touchHoldTimer) {\r\n clearTimeout($this.touchHoldTimer);\r\n $this.touchHoldTimer = null;\r\n }\r\n }\r\n\r\n function buildTouchObj($el, extraOptions) {\r\n var touchObj = $el.$$touchObj || {\r\n // an object contains all callbacks registered,\r\n // key is event name, value is an array\r\n callbacks: {},\r\n // prevent bind twice, set to true when event bound\r\n hasBindTouchEvents: false,\r\n // default options, would be override by v-touch-options\r\n options: globalOptions\r\n };\r\n if (extraOptions) {\r\n touchObj.options = Object.assign({}, touchObj.options, extraOptions);\r\n }\r\n $el.$$touchObj = touchObj;\r\n return $el.$$touchObj;\r\n }\r\n\r\n app.directive('touch', {\r\n beforeMount: function ($el, binding) {\r\n // build a touch configuration object\r\n var $this = buildTouchObj($el);\r\n // declare passive option for the event listener. Defaults to { passive: true } if supported\r\n var passiveOpt = isPassiveSupported ? { passive: true } : false;\r\n // register callback\r\n var eventType = binding.arg || 'tap';\r\n switch (eventType) {\r\n case 'swipe':\r\n var _m = binding.modifiers;\r\n if (_m.left || _m.right || _m.top || _m.bottom) {\r\n for (var i in binding.modifiers) {\r\n if (['left', 'right', 'top', 'bottom'].indexOf(i) >= 0) {\r\n var _e = 'swipe.' + i;\r\n $this.callbacks[_e] = $this.callbacks[_e] || [];\r\n $this.callbacks[_e].push(binding);\r\n }\r\n }\r\n } else {\r\n $this.callbacks.swipe = $this.callbacks.swipe || [];\r\n $this.callbacks.swipe.push(binding);\r\n }\r\n break;\r\n\r\n case 'press':\r\n case 'drag':\r\n if (binding.modifiers.disablePassive) {\r\n // change the passive option for the `drag` event if disablePassive modifier exists\r\n passiveOpt = false;\r\n }\r\n default:\r\n $this.callbacks[eventType] = $this.callbacks[eventType] || [];\r\n $this.callbacks[eventType].push(binding);\r\n }\r\n\r\n // prevent bind twice\r\n if ($this.hasBindTouchEvents) {\r\n return;\r\n }\r\n\r\n $el.addEventListener('touchstart', touchStartEvent, passiveOpt);\r\n $el.addEventListener('touchmove', touchMoveEvent, passiveOpt);\r\n $el.addEventListener('touchcancel', touchCancelEvent);\r\n $el.addEventListener('touchend', touchEndEvent);\r\n\r\n if (!$this.options.disableClick) {\r\n $el.addEventListener('mousedown', touchStartEvent);\r\n $el.addEventListener('mousemove', touchMoveEvent);\r\n $el.addEventListener('mouseup', touchEndEvent);\r\n $el.addEventListener('mouseenter', mouseEnterEvent);\r\n $el.addEventListener('mouseleave', mouseLeaveEvent);\r\n }\r\n\r\n // set bind mark to true\r\n $this.hasBindTouchEvents = true;\r\n },\r\n\r\n unmounted: function ($el) {\r\n $el.removeEventListener('touchstart', touchStartEvent);\r\n $el.removeEventListener('touchmove', touchMoveEvent);\r\n $el.removeEventListener('touchcancel', touchCancelEvent);\r\n $el.removeEventListener('touchend', touchEndEvent);\r\n\r\n if ($el.$$touchObj && !$el.$$touchObj.options.disableClick) {\r\n $el.removeEventListener('mousedown', touchStartEvent);\r\n $el.removeEventListener('mousemove', touchMoveEvent);\r\n $el.removeEventListener('mouseup', touchEndEvent);\r\n $el.removeEventListener('mouseenter', mouseEnterEvent);\r\n $el.removeEventListener('mouseleave', mouseLeaveEvent);\r\n }\r\n\r\n // remove vars\r\n delete $el.$$touchObj;\r\n }\r\n });\r\n\r\n app.directive('touch-class', {\r\n beforeMount: function ($el, binding) {\r\n buildTouchObj($el, {\r\n touchClass: binding.value\r\n });\r\n }\r\n });\r\n\r\n app.directive('touch-options', {\r\n beforeMount: function($el, binding) {\r\n buildTouchObj($el, binding.value);\r\n }\r\n });\r\n }\r\n};\r\n\r\n/*\r\n * Exports\r\n */\r\nexport default vueTouchEvents","export default class Deferred<T> {\n public promise: Promise<T>;\n\n public reject!: (value: T | PromiseLike<T>) => void;\n public resolve!: (value: T | PromiseLike<T>) => void;\n\n constructor() {\n this.promise = new Promise((resolve, reject) => {\n this.reject = reject;\n this.resolve = resolve;\n });\n }\n}\n","import { h, reactive, readonly, ref } from 'vue';\n\nimport { DialogProps } from '../../components/Dialog/Dialog.vue';\nimport Deferred from '../../utils/Deferred';\n\nexport interface Result {\n isConfirmed?: boolean;\n isCanceled?: boolean;\n}\n\nexport interface ActiveDialog extends DialogProps {\n deferred?: Deferred<Result>;\n onConfirm?: () => void;\n onCancel?: () => void;\n slots?: Record<string, typeof h>;\n}\n\nconst active = ref<ActiveDialog>();\n\nexport default function useDialog() {\n function open(dialog: Omit<ActiveDialog, 'deferred'>) {\n if (active.value) {\n throw new Error('A Dialog is already being displayed');\n }\n\n active.value = {\n ...dialog,\n deferred: new Deferred(),\n };\n\n return active.value.deferred?.promise;\n }\n\n function close() {\n active.value = undefined;\n }\n\n return reactive({\n /**\n * The currently open dialog information.\n */\n active: readonly(active),\n\n /**\n * Opens the dialog.\n */\n open,\n\n /**\n * Closes the dialog.\n */\n close,\n });\n}\n","<script setup lang=\"ts\">\n import omit from 'lodash-es/omit';\n import { computed } from 'vue';\n\n import useDialog from '../../composables/useDialog/useDialog';\n import CustomRender from '../CustomRender/CustomRender.vue';\n import Dialog from '../Dialog/Dialog.vue';\n\n const dialog = useDialog();\n\n const attributes = computed(() => {\n if (!dialog.active) return null;\n\n return omit(dialog.active, ['deferred', 'onConfirm', 'onCancel', 'slots']);\n });\n\n function onCancel() {\n if (dialog.active?.onCancel) {\n dialog.active.onCancel();\n }\n\n dialog.active?.deferred?.resolve({\n isCanceled: true,\n });\n\n dialog.close();\n }\n\n async function onConfirm() {\n if (dialog.active?.onConfirm) {\n await dialog.active.onConfirm();\n }\n\n dialog.active?.deferred?.resolve({\n isConfirmed: true,\n });\n\n dialog.close();\n }\n</script>\n\n<template>\n <Dialog :open=\"!!attributes\" v-bind=\"attributes\" @confirm=\"onConfirm\" @cancel=\"onCancel\">\n <template v-for=\"(value, name) in dialog.active?.slots\" :key=\"name\" #[name]>\n <CustomRender :render=\"value\" />\n </template>\n </Dialog>\n</template>\n","import { App, createVNode, h, Plugin, render } from 'vue';\n\nimport Dialogs from '../components/Dialogs/Dialogs.vue';\n\nexport interface DialogsPluginOptions {\n mountNodeClass?: string;\n mountNodeId?: string;\n}\n\nexport default <Plugin>{\n install(app: App, options?: DialogsPluginOptions) {\n const mountNodeId = options?.mountNodeId || 'stash-dialogs-mount-node';\n let mountNode = document.getElementById(mountNodeId);\n\n if (!mountNode) {\n mountNode = document.createElement('div');\n mountNode.id = mountNodeId;\n }\n\n if (options?.mountNodeClass) {\n mountNode.classList.add(options.mountNodeClass);\n }\n\n const vNode = createVNode(h(Dialogs));\n document.body.appendChild(mountNode);\n vNode.appContext = app._context;\n\n render(vNode, mountNode);\n },\n};\n","/**\n * The names of the color groups.\n */\nexport type StashPrimaryColorGroup =\n | 'blue'\n | 'green'\n | 'ice'\n | 'orange'\n | 'purple'\n | 'red'\n | 'royal'\n | 'seafoam'\n | 'teal'\n | 'yellow';\n\n/**\n * Complete list of Stash brand colors & their shades.\n */\nexport enum StashColors {\n Purple900 = 'purple-900',\n Purple800 = 'purple-800',\n Purple700 = 'purple-700',\n Purple600 = 'purple-600',\n Purple500 = 'purple-500',\n Purple400 = 'purple-400',\n Purple300 = 'purple-300',\n Purple200 = 'purple-200',\n Purple100 = 'purple-100',\n\n Royal900 = 'royal-900',\n Royal800 = 'royal-800',\n Royal700 = 'royal-700',\n Royal600 = 'royal-600',\n Royal500 = 'royal-500',\n Royal400 = 'royal-400',\n Royal300 = 'royal-300',\n Royal200 = 'royal-200',\n Royal100 = 'royal-100',\n\n Blue900 = 'blue-900',\n Blue800 = 'blue-800',\n Blue700 = 'blue-700',\n Blue600 = 'blue-600',\n Blue500 = 'blue-500',\n Blue400 = 'blue-400',\n Blue300 = 'blue-300',\n Blue200 = 'blue-200',\n Blue100 = 'blue-100',\n\n Teal900 = 'teal-900',\n Teal800 = 'teal-800',\n Teal700 = 'teal-700',\n Teal600 = 'teal-600',\n Teal500 = 'teal-500',\n Teal400 = 'teal-400',\n Teal300 = 'teal-300',\n Teal200 = 'teal-200',\n Teal100 = 'teal-100',\n\n Green900 = 'green-900',\n Green800 = 'green-800',\n Green700 = 'green-700',\n Green600 = 'green-600',\n Green500 = 'green-500',\n Green400 = 'green-400',\n Green300 = 'green-300',\n Green200 = 'green-200',\n Green100 = 'green-100',\n\n Seafoam900 = 'seafoam-900',\n Seafoam800 = 'seafoam-800',\n Seafoam700 = 'seafoam-700',\n Seafoam600 = 'seafoam-600',\n Seafoam500 = 'seafoam-500',\n Seafoam400 = 'seafoam-400',\n Seafoam300 = 'seafoam-300',\n Seafoam200 = 'seafoam-200',\n Seafoam100 = 'seafoam-100',\n\n Yellow900 = 'yellow-900',\n Yellow800 = 'yellow-800',\n Yellow700 = 'yellow-700',\n Yellow600 = 'yellow-600',\n Yellow500 = 'yellow-500',\n Yellow400 = 'yellow-400',\n Yellow300 = 'yellow-300',\n Yellow200 = 'yellow-200',\n Yellow100 = 'yellow-100',\n\n Orange900 = 'orange-900',\n Orange800 = 'orange-800',\n Orange700 = 'orange-700',\n Orange600 = 'orange-600',\n Orange500 = 'orange-500',\n Orange400 = 'orange-400',\n Orange300 = 'orange-300',\n Orange200 = 'orange-200',\n Orange100 = 'orange-100',\n\n Red900 = 'red-900',\n Red800 = 'red-800',\n Red700 = 'red-700',\n Red600 = 'red-600',\n Red500 = 'red-500',\n Red400 = 'red-400',\n Red300 = 'red-300',\n Red200 = 'red-200',\n Red100 = 'red-100',\n\n Ice900 = 'ice-900',\n Ice800 = 'ice-800',\n Ice700 = 'ice-700',\n Ice600 = 'ice-600',\n Ice500 = 'ice-500',\n Ice400 = 'ice-400',\n Ice300 = 'ice-300',\n Ice200 = 'ice-200',\n Ice100 = 'ice-100',\n\n White = 'white',\n Black = 'black',\n}\n\nexport type StashColor = `${StashColors}`;\n\n/**\n * A limited list of stash brand colors, only including their 100, 500, and 700 shades.\n */\nexport enum StashCommonColors {\n Purple700 = StashColors.Purple700,\n Purple500 = StashColors.Purple500,\n Purple100 = StashColors.Purple100,\n\n Royal700 = StashColors.Royal700,\n Royal500 = StashColors.Royal500,\n Royal100 = StashColors.Royal100,\n\n Blue700 = StashColors.Blue700,\n Blue500 = StashColors.Blue500,\n Blue100 = StashColors.Blue100,\n\n Teal700 = StashColors.Teal700,\n Teal500 = StashColors.Teal500,\n Teal100 = StashColors.Teal100,\n\n Green700 = StashColors.Green700,\n Green500 = StashColors.Green500,\n Green100 = StashColors.Green100,\n\n Seafoam700 = StashColors.Seafoam700,\n Seafoam500 = StashColors.Seafoam500,\n Seafoam100 = StashColors.Seafoam100,\n\n Yellow700 = StashColors.Yellow700,\n Yellow500 = StashColors.Yellow500,\n Yellow100 = StashColors.Yellow100,\n\n Orange700 = StashColors.Orange700,\n Orange500 = StashColors.Orange500,\n Orange100 = StashColors.Orange100,\n\n Red700 = StashColors.Red700,\n Red500 = StashColors.Red500,\n Red100 = StashColors.Red100,\n\n Ice700 = StashColors.Ice700,\n Ice500 = StashColors.Ice500,\n Ice200 = StashColors.Ice200, // This is the one outlier, but it's used purposefully in a few places\n Ice100 = StashColors.Ice100,\n\n White = 'white',\n Black = 'black',\n}\n\nexport type StashCommonColor = `${StashCommonColors}`;\n\n/**\n * A limited list of stash brand colors, only including their primary (500) shade.\n */\nexport enum StashPrimaryColors {\n Blue500 = 'blue-500',\n Green500 = 'green-500',\n Ice500 = 'ice-500',\n Orange500 = 'orange-500',\n Purple500 = 'purple-500',\n Red500 = 'red-500',\n Royal500 = 'royal-500',\n Seafoam500 = 'seafoam-500',\n Teal500 = 'teal-500',\n Yellow500 = 'yellow-500',\n}\n\nexport type StashPrimaryColor = `${StashPrimaryColors}`;\n","import { Plugin } from 'vue';\nimport Vue3TouchEvents from 'vue3-touch-events';\n\nimport { I18nPlugin, StashOptionImages, StashProvideState } from '../types/misc';\nimport locale from './locale';\n// this is valid syntax per the TS docs, but prettier throws an error expecting a comma after `type`\n// eslint-disable-next-line prettier/prettier\nimport DialogsPlugin, { type DialogsPluginOptions } from './plugins/DialogsPlugin';\nimport MenusPlugin, { type MenusPluginOptions } from './plugins/MenusPlugin';\nimport ModalsPlugin, { type ModalsPluginOptions } from './plugins/ModalsPlugin';\nimport ToastsPlugin, { type ToastsPluginOptions } from './plugins/ToastsPlugin';\nimport { overridePersistentStorage, persistentStorage } from './storage';\n\nexport interface StashPluginOptions {\n i18n?: I18nPlugin;\n storage?: {\n set: <T = unknown>(name: string, data: T, options?: { [key: string]: unknown }) => void;\n get: <T = unknown>(name: string, options?: { [key: string]: unknown }) => T;\n };\n staticPath?: string;\n images?: StashOptionImages;\n googleMapsApiKey?: string;\n menus?: false | MenusPluginOptions;\n modals?: false | ModalsPluginOptions;\n toasts?: false | ToastsPluginOptions;\n dialogs?: false | DialogsPluginOptions;\n}\n\nexport default <Plugin>{\n install(\n app,\n {\n i18n = undefined,\n storage = undefined,\n staticPath = '/static',\n images = {\n provider: 'cloudinary',\n staticDomains: [],\n },\n googleMapsApiKey = undefined,\n menus,\n modals,\n toasts,\n dialogs,\n }: StashPluginOptions = {},\n ) {\n app.use(Vue3TouchEvents);\n\n // locale\n if (i18n) {\n locale.use(i18n.locale);\n locale.i18n(i18n && i18n.t);\n }\n\n // persistent storage (localStorage)\n if (storage) {\n overridePersistentStorage(storage);\n }\n\n // expose stash options to the rest of your application\n app.provide<StashProvideState>('stashOptions', {\n i18n,\n images,\n storage,\n staticPath,\n googleMapsApiKey,\n });\n\n if (menus !== false) {\n app.use(MenusPlugin, menus);\n }\n\n if (modals !== false) {\n app.use(ModalsPlugin, modals);\n }\n\n if (toasts !== false) {\n app.use(ToastsPlugin, toasts);\n }\n\n if (dialogs !== false) {\n app.use(DialogsPlugin, dialogs);\n }\n },\n};\n\nexport { persistentStorage };\n\n// Re-export things that are useful for consumers\nexport * from '../types';\nexport * from './storage';\n\n// Todo: Investigate tree-shaking issues to see if we can expose these. Theoritically\n// should be no issue, however test framework startup time, specifically w/ Jest,\n// seems to be the major blocker here.\n// export * from './components';\n// export * from './composables';\n// export * from './constants';\n// export * from './directives';\n// export * from './locale';\n// export * from './plugins';\n// export { default as ToastsPlugin } from './plugins/ToastsPlugin';\n"],"names":["touchX","event","touchY","isPassiveSupported","supportsPassive","opts","vueTouchEvents","app","constructorOptions","globalOptions","touchStartEvent","$this","isTouchEvent","isMouseEvent","$el","addTouchClass","hasEvent","triggerEvent","touchMoveEvent","curX","curY","movedAgain","swipeOutBounded","tapTolerance","cancelTouchHoldTimer","now","throttle","touchCancelEvent","removeTouchClass","touchEndEvent","touchholdEnd","direction","distanceY","distanceX","mouseEnterEvent","mouseLeaveEvent","eventType","callbacks","e","param","i","binding","className","buildTouchObj","extraOptions","touchObj","passiveOpt","_m","_e","Deferred","__publicField","resolve","reject","active","ref","useDialog","open","dialog","_a","close","reactive","readonly","attributes","computed","omit","onCancel","_c","_b","onConfirm","DialogsPlugin","options","mountNodeId","mountNode","vNode","createVNode","h","Dialogs","render","StashColors","StashCommonColors","StashPrimaryColors","index","i18n","storage","staticPath","images","googleMapsApiKey","menus","modals","toasts","dialogs","Vue3TouchEvents","locale","overridePersistentStorage","MenusPlugin","ModalsPlugin","ToastsPlugin"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAOA,SAASA,EAAOC,GAAO;AACnB,SAAGA,EAAM,KAAK,QAAQ,OAAO,MAAM,KACxBA,EAAM,UAEVA,EAAM,QAAQ,CAAC,EAAE;AAC5B;AAEA,SAASC,EAAOD,GAAO;AACnB,SAAGA,EAAM,KAAK,QAAQ,OAAO,MAAM,KACxBA,EAAM,UAEVA,EAAM,QAAQ,CAAC,EAAE;AAC5B;AAEA,IAAIE,IAAsB,WAAW;AACjC,MAAIC,IAAkB;AACtB,MAAI;AACA,QAAIC,IAAO,OAAO,eAAe,CAAA,GAAI,WAAW;AAAA,MAC5C,KAAK,WAAW;AACZ,QAAAD,IAAkB;AAAA,MACrB;AAAA,IACb,CAAS;AACD,WAAO,iBAAiB,QAAQ,MAAMC,CAAI;AAAA,EAClD,QAAgB;AAAA,EAAE;AACd,SAAOD;AACX,KAEIE,KAAiB;AAAA,EACjB,SAAS,SAAUC,GAAKC,GAAoB;AAExC,QAAIC,IAAgB,OAAO,OAAO,IAAI;AAAA,MAClC,cAAc;AAAA,MACd,cAAc;AAAA;AAAA,MACd,gBAAgB;AAAA;AAAA,MAChB,oBAAoB;AAAA;AAAA,MACpB,qBAAqB;AAAA;AAAA,MACrB,YAAY;AAAA,MACrB,eAAe;AAAA;AAAA,MACf,mBAAmB;AAAA;AAAA,IACb,GAAED,CAAkB;AAErB,aAASE,EAAgBT,GAAO;AAC5B,UAAIU,IAAQ,KAAK,YACbC,IAAeX,EAAM,KAAK,QAAQ,OAAO,KAAK,GAC9CY,IAAeZ,EAAM,KAAK,QAAQ,OAAO,KAAK,GAC9Ca,IAAM;AAMV,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,WACTA,EAAA,WAAW,aACXA,EAAA,aAAa,eACbA,EAAA,UAAU,YACVA,EAAA,YAAY,cAVFA,IAAAA,MAAA,CAAA,CAAA;ACvJZ,MAAuBC,KAAA;AAAA,EACrB,QACE1E,GACA;AAAA,IACE,MAAA2E,IAAO;AAAA,IACP,SAAAC,IAAU;AAAA,IACV,YAAAC,IAAa;AAAA,IACb,QAAAC,IAAS;AAAA,MACP,UAAU;AAAA,MACV,eAAe,CAAC;AAAA,IAClB;AAAA,IACA,kBAAAC,IAAmB;AAAA,IACnB,OAAAC;AAAA,IACA,QAAAC;AAAA,IACA,QAAAC;AAAA,IACA,SAAAC;AAAA,EACF,IAAyB,IACzB;AACA,IAAAnF,EAAI,IAAIoF,EAAe,GAGnBT,MACKU,EAAA,IAAIV,EAAK,MAAM,GACfU,EAAA,KAAKV,KAAQA,EAAK,CAAC,IAIxBC,KACFU,EAA0BV,CAAO,GAInC5E,EAAI,QAA2B,gBAAgB;AAAA,MAC7C,MAAA2E;AAAA,MACA,QAAAG;AAAA,MACA,SAAAF;AAAA,MACA,YAAAC;AAAA,MACA,kBAAAE;AAAA,IAAA,CACD,GAEGC,MAAU,MACRhF,EAAA,IAAIuF,GAAaP,CAAK,GAGxBC,MAAW,MACTjF,EAAA,IAAIwF,GAAcP,CAAM,GAG1BC,MAAW,MACTlF,EAAA,IAAIyF,GAAcP,CAAM,GAG1BC,MAAY,MACVnF,EAAA,IAAI8D,IAAeqB,CAAO;AAAA,EAElC;AACF;","x_google_ignoreList":[0]}
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../node_modules/vue3-touch-events/index.js","../src/utils/Deferred.ts","../src/composables/useDialog/useDialog.ts","../src/components/Dialogs/Dialogs.vue","../src/plugins/DialogsPlugin.ts","../types/colors.ts","../src/index.ts"],"sourcesContent":["/**\r\n * @project vue3-touch-events\r\n * @author Robin Rodricks, Xavier Julien, Jerry Bendy\r\n * @since 30/4/2021\r\n * @url https://github.com/robinrodricks/vue3-touch-events\r\n */\r\n\r\nfunction touchX(event) {\r\n if(event.type.indexOf('mouse') !== -1){\r\n return event.clientX;\r\n }\r\n return event.touches[0].clientX;\r\n}\r\n\r\nfunction touchY(event) {\r\n if(event.type.indexOf('mouse') !== -1){\r\n return event.clientY;\r\n }\r\n return event.touches[0].clientY;\r\n}\r\n\r\nvar isPassiveSupported = (function() {\r\n var supportsPassive = false;\r\n try {\r\n var opts = Object.defineProperty({}, 'passive', {\r\n get: function() {\r\n supportsPassive = true;\r\n }\r\n });\r\n window.addEventListener('test', null, opts);\r\n } catch (e) {}\r\n return supportsPassive;\r\n})();\r\n\r\nvar vueTouchEvents = {\r\n install: function (app, constructorOptions) {\r\n\t\t\r\n var globalOptions = Object.assign({}, {\r\n disableClick: false,\r\n tapTolerance: 10, // px\r\n swipeTolerance: 30, // px\r\n touchHoldTolerance: 400, // ms\r\n longTapTimeInterval: 400, // ms\r\n touchClass: '',\r\n\t\t\tdragFrequency: 100, // ms\r\n\t\t\trollOverFrequency: 100, // ms\r\n }, constructorOptions);\r\n\r\n function touchStartEvent(event) {\r\n var $this = this.$$touchObj,\r\n isTouchEvent = event.type.indexOf('touch') >= 0,\r\n isMouseEvent = event.type.indexOf('mouse') >= 0,\r\n $el = this;\r\n\r\n if (isTouchEvent) {\r\n $this.lastTouchStartTime = event.timeStamp;\r\n }\r\n\r\n if (isMouseEvent && $this.lastTouchStartTime && event.timeStamp - $this.lastTouchStartTime < 350) {\r\n return;\r\n }\r\n\r\n if ($this.touchStarted) {\r\n return;\r\n }\r\n\r\n addTouchClass(this);\r\n\r\n $this.touchStarted = true; // always true while the element is being PRESSED\r\n\r\n $this.touchMoved = false; // true only when the element is PRESSED and DRAGGED a bit\r\n $this.swipeOutBounded = false;\r\n\r\n $this.startX = touchX(event);\r\n $this.startY = touchY(event);\r\n\r\n $this.currentX = 0; // always updated with the last mouse X/Y while over the element\r\n $this.currentY = 0;\r\n\r\n $this.touchStartTime = event.timeStamp;\r\n\t\t\t\r\n\t\t\t// performance: only process swipe events if `swipe.*` event is registered on this element\r\n\t\t\t$this.hasSwipe = hasEvent(this, 'swipe')\r\n\t\t\t\t|| hasEvent(this, 'swipe.left') || hasEvent(this, 'swipe.right')\r\n\t\t\t\t|| hasEvent(this, 'swipe.top') || hasEvent(this, 'swipe.bottom');\r\n\r\n\t\t\t// performance: only start hold timer if the `hold` event is registered on this element\r\n\t\t\tif (hasEvent(this, 'hold')){\r\n\t\t\t\t\r\n\t\t\t\t// Trigger touchhold event after `touchHoldTolerance` MS\r\n\t\t\t\t$this.touchHoldTimer = setTimeout(function() {\r\n\t\t\t\t\t$this.touchHoldTimer = null;\r\n\t\t\t\t\ttriggerEvent(event, $el, 'hold');\r\n\t\t\t\t}, $this.options.touchHoldTolerance);\r\n\t\t\t}\r\n\t\t\t\r\n triggerEvent(event, this, 'press');\r\n }\r\n\r\n function touchMoveEvent(event) {\r\n var $this = this.$$touchObj;\r\n\t\t\t\r\n\t\t\tvar curX = touchX(event);\r\n\t\t\tvar curY = touchY(event);\r\n\r\n\t\t\tvar movedAgain = ($this.currentX != curX) || ($this.currentY != curY);\r\n\t\t\t\r\n $this.currentX = curX;\r\n $this.currentY = curY;\r\n\r\n if (!$this.touchMoved) {\r\n var tapTolerance = $this.options.tapTolerance;\r\n\r\n $this.touchMoved = Math.abs($this.startX - $this.currentX) > tapTolerance ||\r\n\t\t\t\t\t\t\t\t Math.abs($this.startY - $this.currentY) > tapTolerance;\r\n\r\n\t\t\t\t// trigger `drag.once` only once after mouse FIRST moved while dragging the element\r\n\t\t\t\t// (`touchMoved` is the flag that indicates we no longer need to trigger this)\r\n if($this.touchMoved){\r\n cancelTouchHoldTimer($this);\r\n triggerEvent(event, this, 'drag.once');\r\n }\r\n\r\n\t\t\t// performance: only process swipe events if `swipe.*` event is registered on this element\r\n } else if ($this.hasSwipe && !$this.swipeOutBounded) {\r\n\t\t\t\tvar swipeOutBounded = $this.options.swipeTolerance;\r\n\r\n\t\t\t\t$this.swipeOutBounded = Math.abs($this.startX - $this.currentX) > swipeOutBounded &&\r\n\t\t\t\t\tMath.abs($this.startY - $this.currentY) > swipeOutBounded;\r\n }\r\n\r\n\t\t\t// only trigger `rollover` event if cursor actually moved over this element\r\n if(hasEvent(this, 'rollover') && movedAgain){\r\n\t\t\t\t\r\n\t\t\t\t// throttle the `rollover` event based on `rollOverFrequency`\r\n\t\t\t\tvar now = event.timeStamp;\r\n\t\t\t\tvar throttle = $this.options.rollOverFrequency;\r\n\t\t\t\tif ($this.touchRollTime == null || now > ($this.touchRollTime + throttle)){\r\n\t\t\t\t\t$this.touchRollTime = now;\r\n\t\t\t\t\t\r\n\t\t\t\t\ttriggerEvent(event, this, 'rollover');\r\n\t\t\t\t}\r\n }\r\n\r\n\t\t\t// only trigger `drag` event if cursor actually moved and if we are still dragging this element\r\n if(hasEvent(this, 'drag') && $this.touchStarted && $this.touchMoved && movedAgain){\r\n\t\t\t\t\r\n\t\t\t\t// throttle the `drag` event based on `dragFrequency`\r\n\t\t\t\tvar now = event.timeStamp;\r\n\t\t\t\tvar throttle = $this.options.dragFrequency;\r\n\t\t\t\tif ($this.touchDragTime == null || now > ($this.touchDragTime + throttle)){\r\n\t\t\t\t\t$this.touchDragTime = now;\r\n\t\t\t\t\t\r\n\t\t\t\t\ttriggerEvent(event, this, 'drag');\r\n\t\t\t\t}\r\n }\r\n }\r\n\r\n function touchCancelEvent() {\r\n var $this = this.$$touchObj;\r\n\r\n cancelTouchHoldTimer($this);\r\n removeTouchClass(this);\r\n\r\n $this.touchStarted = $this.touchMoved = false;\r\n $this.startX = $this.startY = 0;\r\n }\r\n\r\n function touchEndEvent(event) {\r\n var $this = this.$$touchObj,\r\n isTouchEvent = event.type.indexOf('touch') >= 0,\r\n isMouseEvent = event.type.indexOf('mouse') >= 0;\r\n\r\n if (isTouchEvent) {\r\n $this.lastTouchEndTime = event.timeStamp;\r\n }\r\n\r\n var touchholdEnd = isTouchEvent && !$this.touchHoldTimer;\r\n cancelTouchHoldTimer($this);\r\n\r\n $this.touchStarted = false;\r\n\r\n removeTouchClass(this);\r\n\r\n if (isMouseEvent && $this.lastTouchEndTime && event.timeStamp - $this.lastTouchEndTime < 350) {\r\n return;\r\n }\r\n\r\n // trigger `end` event when touch stopped\r\n triggerEvent(event, this, 'release');\r\n\r\n if (!$this.touchMoved) {\r\n // detect if this is a longTap event or not\r\n if (hasEvent(this, 'longtap') && event.timeStamp - $this.touchStartTime > $this.options.longTapTimeInterval) {\r\n if (event.cancelable) {\r\n event.preventDefault();\r\n }\r\n triggerEvent(event, this, 'longtap');\r\n\r\n } else if (hasEvent(this, 'hold') && touchholdEnd) {\r\n if (event.cancelable) {\r\n event.preventDefault();\r\n }\r\n return;\r\n } else {\r\n // emit tap event\r\n triggerEvent(event, this, 'tap');\r\n }\r\n\r\n\t\t\t// performance: only process swipe events if `swipe.*` event is registered on this element\r\n } else if ($this.hasSwipe && !$this.swipeOutBounded) {\r\n var swipeOutBounded = $this.options.swipeTolerance,\r\n direction,\r\n distanceY = Math.abs($this.startY - $this.currentY),\r\n distanceX = Math.abs($this.startX - $this.currentX);\r\n\r\n if (distanceY > swipeOutBounded || distanceX > swipeOutBounded) {\r\n if (distanceY > swipeOutBounded) {\r\n direction = $this.startY > $this.currentY ? 'top' : 'bottom';\r\n } else {\r\n direction = $this.startX > $this.currentX ? 'left' : 'right';\r\n }\r\n\r\n // Only emit the specified event when it has modifiers\r\n if (hasEvent(this, 'swipe.' + direction)) {\r\n triggerEvent(event, this, 'swipe.' + direction, direction);\r\n } else {\r\n // Emit a common event when it has no any modifier\r\n triggerEvent(event, this, 'swipe', direction);\r\n }\r\n }\r\n }\r\n }\r\n\r\n function mouseEnterEvent() {\r\n addTouchClass(this);\r\n }\r\n\r\n function mouseLeaveEvent() {\r\n removeTouchClass(this);\r\n }\r\n\r\n function hasEvent($el, eventType) {\r\n var callbacks = $el.$$touchObj.callbacks[eventType];\r\n\t\t\treturn (callbacks != null && callbacks.length > 0);\r\n\t\t}\r\n\t\t\r\n function triggerEvent(e, $el, eventType, param) {\r\n var $this = $el.$$touchObj;\r\n\r\n // get the subscribers for this event\r\n var callbacks = $this.callbacks[eventType];\r\n\t\t\t\r\n\t\t\t// exit if no subscribers to this particular event\r\n if (callbacks == null || callbacks.length === 0) {\r\n return null;\r\n }\r\n\r\n\t\t\t// per callback\r\n for (var i = 0; i < callbacks.length; i++) {\r\n var binding = callbacks[i];\r\n\r\n if (binding.modifiers.stop) {\r\n e.stopPropagation();\r\n }\r\n\r\n if (binding.modifiers.prevent) {\r\n e.preventDefault();\r\n }\r\n\r\n // handle `self` modifier`\r\n if (binding.modifiers.self && e.target !== e.currentTarget) {\r\n continue;\r\n }\r\n\r\n if (typeof binding.value === 'function') {\r\n if (param) {\r\n binding.value(param, e);\r\n } else {\r\n binding.value(e);\r\n }\r\n }\r\n }\r\n }\r\n\r\n function addTouchClass($el) {\r\n var className = $el.$$touchObj.options.touchClass;\r\n className && $el.classList.add(className);\r\n }\r\n\r\n function removeTouchClass($el) {\r\n var className = $el.$$touchObj.options.touchClass;\r\n className && $el.classList.remove(className);\r\n }\r\n\r\n function cancelTouchHoldTimer($this) {\r\n if ($this.touchHoldTimer) {\r\n clearTimeout($this.touchHoldTimer);\r\n $this.touchHoldTimer = null;\r\n }\r\n }\r\n\r\n function buildTouchObj($el, extraOptions) {\r\n var touchObj = $el.$$touchObj || {\r\n // an object contains all callbacks registered,\r\n // key is event name, value is an array\r\n callbacks: {},\r\n // prevent bind twice, set to true when event bound\r\n hasBindTouchEvents: false,\r\n // default options, would be override by v-touch-options\r\n options: globalOptions\r\n };\r\n if (extraOptions) {\r\n touchObj.options = Object.assign({}, touchObj.options, extraOptions);\r\n }\r\n $el.$$touchObj = touchObj;\r\n return $el.$$touchObj;\r\n }\r\n\r\n app.directive('touch', {\r\n beforeMount: function ($el, binding) {\r\n // build a touch configuration object\r\n var $this = buildTouchObj($el);\r\n // declare passive option for the event listener. Defaults to { passive: true } if supported\r\n var passiveOpt = isPassiveSupported ? { passive: true } : false;\r\n // register callback\r\n var eventType = binding.arg || 'tap';\r\n switch (eventType) {\r\n case 'swipe':\r\n var _m = binding.modifiers;\r\n if (_m.left || _m.right || _m.top || _m.bottom) {\r\n for (var i in binding.modifiers) {\r\n if (['left', 'right', 'top', 'bottom'].indexOf(i) >= 0) {\r\n var _e = 'swipe.' + i;\r\n $this.callbacks[_e] = $this.callbacks[_e] || [];\r\n $this.callbacks[_e].push(binding);\r\n }\r\n }\r\n } else {\r\n $this.callbacks.swipe = $this.callbacks.swipe || [];\r\n $this.callbacks.swipe.push(binding);\r\n }\r\n break;\r\n\r\n case 'press':\r\n case 'drag':\r\n if (binding.modifiers.disablePassive) {\r\n // change the passive option for the `drag` event if disablePassive modifier exists\r\n passiveOpt = false;\r\n }\r\n default:\r\n $this.callbacks[eventType] = $this.callbacks[eventType] || [];\r\n $this.callbacks[eventType].push(binding);\r\n }\r\n\r\n // prevent bind twice\r\n if ($this.hasBindTouchEvents) {\r\n return;\r\n }\r\n\r\n $el.addEventListener('touchstart', touchStartEvent, passiveOpt);\r\n $el.addEventListener('touchmove', touchMoveEvent, passiveOpt);\r\n $el.addEventListener('touchcancel', touchCancelEvent);\r\n $el.addEventListener('touchend', touchEndEvent);\r\n\r\n if (!$this.options.disableClick) {\r\n $el.addEventListener('mousedown', touchStartEvent);\r\n $el.addEventListener('mousemove', touchMoveEvent);\r\n $el.addEventListener('mouseup', touchEndEvent);\r\n $el.addEventListener('mouseenter', mouseEnterEvent);\r\n $el.addEventListener('mouseleave', mouseLeaveEvent);\r\n }\r\n\r\n // set bind mark to true\r\n $this.hasBindTouchEvents = true;\r\n },\r\n\r\n unmounted: function ($el) {\r\n $el.removeEventListener('touchstart', touchStartEvent);\r\n $el.removeEventListener('touchmove', touchMoveEvent);\r\n $el.removeEventListener('touchcancel', touchCancelEvent);\r\n $el.removeEventListener('touchend', touchEndEvent);\r\n\r\n if ($el.$$touchObj && !$el.$$touchObj.options.disableClick) {\r\n $el.removeEventListener('mousedown', touchStartEvent);\r\n $el.removeEventListener('mousemove', touchMoveEvent);\r\n $el.removeEventListener('mouseup', touchEndEvent);\r\n $el.removeEventListener('mouseenter', mouseEnterEvent);\r\n $el.removeEventListener('mouseleave', mouseLeaveEvent);\r\n }\r\n\r\n // remove vars\r\n delete $el.$$touchObj;\r\n }\r\n });\r\n\r\n app.directive('touch-class', {\r\n beforeMount: function ($el, binding) {\r\n buildTouchObj($el, {\r\n touchClass: binding.value\r\n });\r\n }\r\n });\r\n\r\n app.directive('touch-options', {\r\n beforeMount: function($el, binding) {\r\n buildTouchObj($el, binding.value);\r\n }\r\n });\r\n }\r\n};\r\n\r\n/*\r\n * Exports\r\n */\r\nexport default vueTouchEvents","export default class Deferred<T> {\n public promise: Promise<T>;\n\n public reject!: (value: T | PromiseLike<T>) => void;\n public resolve!: (value: T | PromiseLike<T>) => void;\n\n constructor() {\n this.promise = new Promise((resolve, reject) => {\n this.reject = reject;\n this.resolve = resolve;\n });\n }\n}\n","import { h, reactive, readonly, ref } from 'vue';\n\nimport { DialogProps } from '../../components/Dialog/Dialog.vue';\nimport Deferred from '../../utils/Deferred';\n\nexport interface Result {\n isConfirmed?: boolean;\n isCanceled?: boolean;\n}\n\nexport interface ActiveDialog extends DialogProps {\n deferred?: Deferred<Result>;\n onConfirm?: () => void;\n onCancel?: () => void;\n slots?: Record<string, typeof h>;\n}\n\nconst active = ref<ActiveDialog>();\n\nexport default function useDialog() {\n function open(dialog: Omit<ActiveDialog, 'deferred'>) {\n if (active.value) {\n throw new Error('A Dialog is already being displayed');\n }\n\n active.value = {\n ...dialog,\n deferred: new Deferred(),\n };\n\n return active.value.deferred?.promise;\n }\n\n function close() {\n active.value = undefined;\n }\n\n return reactive({\n /**\n * The currently open dialog information.\n */\n active: readonly(active),\n\n /**\n * Opens the dialog.\n */\n open,\n\n /**\n * Closes the dialog.\n */\n close,\n });\n}\n","<script setup lang=\"ts\">\n import omit from 'lodash-es/omit';\n import { computed } from 'vue';\n\n import useDialog from '../../composables/useDialog/useDialog';\n import CustomRender from '../CustomRender/CustomRender.vue';\n import Dialog from '../Dialog/Dialog.vue';\n\n const dialog = useDialog();\n\n const attributes = computed(() => {\n if (!dialog.active) return null;\n\n return omit(dialog.active, ['deferred', 'onConfirm', 'onCancel', 'slots']);\n });\n\n function onCancel() {\n if (dialog.active?.onCancel) {\n dialog.active.onCancel();\n }\n\n dialog.active?.deferred?.resolve({\n isCanceled: true,\n });\n\n dialog.close();\n }\n\n async function onConfirm() {\n if (dialog.active?.onConfirm) {\n await dialog.active.onConfirm();\n }\n\n dialog.active?.deferred?.resolve({\n isConfirmed: true,\n });\n\n dialog.close();\n }\n</script>\n\n<template>\n <Dialog :open=\"!!attributes\" v-bind=\"attributes\" @confirm=\"onConfirm\" @cancel=\"onCancel\">\n <template v-for=\"(value, name) in dialog.active?.slots\" :key=\"name\" #[name]>\n <CustomRender :render=\"value\" />\n </template>\n </Dialog>\n</template>\n","import { App, createVNode, h, Plugin, render } from 'vue';\n\nimport Dialogs from '../components/Dialogs/Dialogs.vue';\n\nexport interface DialogsPluginOptions {\n mountNodeClass?: string;\n mountNodeId?: string;\n}\n\nexport default <Plugin>{\n install(app: App, options?: DialogsPluginOptions) {\n const mountNodeId = options?.mountNodeId || 'stash-dialogs-mount-node';\n let mountNode = document.getElementById(mountNodeId);\n\n if (!mountNode) {\n mountNode = document.createElement('div');\n mountNode.id = mountNodeId;\n }\n\n if (options?.mountNodeClass) {\n mountNode.classList.add(options.mountNodeClass);\n }\n\n const vNode = createVNode(h(Dialogs));\n document.body.appendChild(mountNode);\n vNode.appContext = app._context;\n\n render(vNode, mountNode);\n },\n};\n","/**\n * The names of the color groups.\n */\nexport type StashPrimaryColorGroup =\n | 'blue'\n | 'green'\n | 'ice'\n | 'orange'\n | 'purple'\n | 'red'\n | 'royal'\n | 'seafoam'\n | 'teal'\n | 'yellow';\n\n/**\n * Complete list of Stash brand colors & their shades.\n */\nexport enum StashColors {\n Purple900 = 'purple-900',\n Purple800 = 'purple-800',\n Purple700 = 'purple-700',\n Purple600 = 'purple-600',\n Purple500 = 'purple-500',\n Purple400 = 'purple-400',\n Purple300 = 'purple-300',\n Purple200 = 'purple-200',\n Purple100 = 'purple-100',\n\n Royal900 = 'royal-900',\n Royal800 = 'royal-800',\n Royal700 = 'royal-700',\n Royal600 = 'royal-600',\n Royal500 = 'royal-500',\n Royal400 = 'royal-400',\n Royal300 = 'royal-300',\n Royal200 = 'royal-200',\n Royal100 = 'royal-100',\n\n Blue900 = 'blue-900',\n Blue800 = 'blue-800',\n Blue700 = 'blue-700',\n Blue600 = 'blue-600',\n Blue500 = 'blue-500',\n Blue400 = 'blue-400',\n Blue300 = 'blue-300',\n Blue200 = 'blue-200',\n Blue100 = 'blue-100',\n\n Teal900 = 'teal-900',\n Teal800 = 'teal-800',\n Teal700 = 'teal-700',\n Teal600 = 'teal-600',\n Teal500 = 'teal-500',\n Teal400 = 'teal-400',\n Teal300 = 'teal-300',\n Teal200 = 'teal-200',\n Teal100 = 'teal-100',\n\n Green900 = 'green-900',\n Green800 = 'green-800',\n Green700 = 'green-700',\n Green600 = 'green-600',\n Green500 = 'green-500',\n Green400 = 'green-400',\n Green300 = 'green-300',\n Green200 = 'green-200',\n Green100 = 'green-100',\n\n Seafoam900 = 'seafoam-900',\n Seafoam800 = 'seafoam-800',\n Seafoam700 = 'seafoam-700',\n Seafoam600 = 'seafoam-600',\n Seafoam500 = 'seafoam-500',\n Seafoam400 = 'seafoam-400',\n Seafoam300 = 'seafoam-300',\n Seafoam200 = 'seafoam-200',\n Seafoam100 = 'seafoam-100',\n\n Yellow900 = 'yellow-900',\n Yellow800 = 'yellow-800',\n Yellow700 = 'yellow-700',\n Yellow600 = 'yellow-600',\n Yellow500 = 'yellow-500',\n Yellow400 = 'yellow-400',\n Yellow300 = 'yellow-300',\n Yellow200 = 'yellow-200',\n Yellow100 = 'yellow-100',\n\n Orange900 = 'orange-900',\n Orange800 = 'orange-800',\n Orange700 = 'orange-700',\n Orange600 = 'orange-600',\n Orange500 = 'orange-500',\n Orange400 = 'orange-400',\n Orange300 = 'orange-300',\n Orange200 = 'orange-200',\n Orange100 = 'orange-100',\n\n Red900 = 'red-900',\n Red800 = 'red-800',\n Red700 = 'red-700',\n Red600 = 'red-600',\n Red500 = 'red-500',\n Red400 = 'red-400',\n Red300 = 'red-300',\n Red200 = 'red-200',\n Red100 = 'red-100',\n\n Ice900 = 'ice-900',\n Ice800 = 'ice-800',\n Ice700 = 'ice-700',\n Ice600 = 'ice-600',\n Ice500 = 'ice-500',\n Ice400 = 'ice-400',\n Ice300 = 'ice-300',\n Ice200 = 'ice-200',\n Ice100 = 'ice-100',\n\n White = 'white',\n Black = 'black',\n}\n\nexport type StashColor = `${StashColors}`;\n\n/**\n * A limited list of stash brand colors, only including their 100, 500, and 700 shades.\n */\nexport enum StashCommonColors {\n Purple700 = StashColors.Purple700,\n Purple500 = StashColors.Purple500,\n Purple100 = StashColors.Purple100,\n\n Royal700 = StashColors.Royal700,\n Royal500 = StashColors.Royal500,\n Royal100 = StashColors.Royal100,\n\n Blue700 = StashColors.Blue700,\n Blue500 = StashColors.Blue500,\n Blue100 = StashColors.Blue100,\n\n Teal700 = StashColors.Teal700,\n Teal500 = StashColors.Teal500,\n Teal100 = StashColors.Teal100,\n\n Green700 = StashColors.Green700,\n Green500 = StashColors.Green500,\n Green100 = StashColors.Green100,\n\n Seafoam700 = StashColors.Seafoam700,\n Seafoam500 = StashColors.Seafoam500,\n Seafoam100 = StashColors.Seafoam100,\n\n Yellow700 = StashColors.Yellow700,\n Yellow500 = StashColors.Yellow500,\n Yellow100 = StashColors.Yellow100,\n\n Orange700 = StashColors.Orange700,\n Orange500 = StashColors.Orange500,\n Orange100 = StashColors.Orange100,\n\n Red700 = StashColors.Red700,\n Red500 = StashColors.Red500,\n Red100 = StashColors.Red100,\n\n Ice700 = StashColors.Ice700,\n Ice500 = StashColors.Ice500,\n Ice200 = StashColors.Ice200, // This is the one outlier, but it's used purposefully in a few places\n Ice100 = StashColors.Ice100,\n\n White = 'white',\n Black = 'black',\n}\n\nexport type StashCommonColor = `${StashCommonColors}`;\n\n/**\n * A limited list of stash brand colors, only including their primary (500) shade.\n */\nexport enum StashPrimaryColors {\n Blue500 = 'blue-500',\n Green500 = 'green-500',\n Ice500 = 'ice-500',\n Orange500 = 'orange-500',\n Purple500 = 'purple-500',\n Red500 = 'red-500',\n Royal500 = 'royal-500',\n Seafoam500 = 'seafoam-500',\n Teal500 = 'teal-500',\n Yellow500 = 'yellow-500',\n}\n\nexport type StashPrimaryColor = `${StashPrimaryColors}`;\n","import { Plugin } from 'vue';\nimport Vue3TouchEvents from 'vue3-touch-events';\n\nimport { I18nPlugin, StashOptionImages, StashProvideState } from '../types/misc';\nimport locale from './locale';\n// this is valid syntax per the TS docs, but prettier throws an error expecting a comma after `type`\n// eslint-disable-next-line prettier/prettier\nimport DialogsPlugin, { type DialogsPluginOptions } from './plugins/DialogsPlugin';\nimport MenusPlugin, { type MenusPluginOptions } from './plugins/MenusPlugin';\nimport ModalsPlugin, { type ModalsPluginOptions } from './plugins/ModalsPlugin';\nimport ToastsPlugin, { type ToastsPluginOptions } from './plugins/ToastsPlugin';\nimport { overridePersistentStorage, persistentStorage } from './storage';\n\nexport interface StashPluginOptions {\n i18n?: I18nPlugin;\n storage?: {\n set: <T = unknown>(name: string, data: T, options?: { [key: string]: unknown }) => void;\n get: <T = unknown>(name: string, options?: { [key: string]: unknown }) => T;\n };\n staticPath?: string;\n images?: StashOptionImages;\n googleMapsApiKey?: string;\n menus?: false | MenusPluginOptions;\n modals?: false | ModalsPluginOptions;\n toasts?: false | ToastsPluginOptions;\n dialogs?: false | DialogsPluginOptions;\n}\n\nexport default <Plugin>{\n install(\n app,\n {\n i18n = undefined,\n storage = undefined,\n staticPath = '/static',\n images = {\n provider: 'static',\n staticDomains: [],\n },\n googleMapsApiKey = undefined,\n menus,\n modals,\n toasts,\n dialogs,\n }: StashPluginOptions = {},\n ) {\n app.use(Vue3TouchEvents);\n\n // locale\n if (i18n) {\n locale.use(i18n.locale);\n locale.i18n(i18n && i18n.t);\n }\n\n // persistent storage (localStorage)\n if (storage) {\n overridePersistentStorage(storage);\n }\n\n // expose stash options to the rest of your application\n app.provide<StashProvideState>('stashOptions', {\n i18n,\n images,\n storage,\n staticPath,\n googleMapsApiKey,\n });\n\n if (menus !== false) {\n app.use(MenusPlugin, menus);\n }\n\n if (modals !== false) {\n app.use(ModalsPlugin, modals);\n }\n\n if (toasts !== false) {\n app.use(ToastsPlugin, toasts);\n }\n\n if (dialogs !== false) {\n app.use(DialogsPlugin, dialogs);\n }\n },\n};\n\nexport { persistentStorage };\n\n// Re-export things that are useful for consumers\nexport * from '../types';\nexport * from './storage';\n\n// Todo: Investigate tree-shaking issues to see if we can expose these. Theoritically\n// should be no issue, however test framework startup time, specifically w/ Jest,\n// seems to be the major blocker here.\n// export * from './components';\n// export * from './composables';\n// export * from './constants';\n// export * from './directives';\n// export * from './locale';\n// export * from './plugins';\n// export { default as ToastsPlugin } from './plugins/ToastsPlugin';\n"],"names":["touchX","event","touchY","isPassiveSupported","supportsPassive","opts","vueTouchEvents","app","constructorOptions","globalOptions","touchStartEvent","$this","isTouchEvent","isMouseEvent","$el","addTouchClass","hasEvent","triggerEvent","touchMoveEvent","curX","curY","movedAgain","swipeOutBounded","tapTolerance","cancelTouchHoldTimer","now","throttle","touchCancelEvent","removeTouchClass","touchEndEvent","touchholdEnd","direction","distanceY","distanceX","mouseEnterEvent","mouseLeaveEvent","eventType","callbacks","e","param","i","binding","className","buildTouchObj","extraOptions","touchObj","passiveOpt","_m","_e","Deferred","__publicField","resolve","reject","active","ref","useDialog","open","dialog","_a","close","reactive","readonly","attributes","computed","omit","onCancel","_c","_b","onConfirm","DialogsPlugin","options","mountNodeId","mountNode","vNode","createVNode","h","Dialogs","render","StashColors","StashCommonColors","StashPrimaryColors","index","i18n","storage","staticPath","images","googleMapsApiKey","menus","modals","toasts","dialogs","Vue3TouchEvents","locale","overridePersistentStorage","Men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AAA2E,IAAO;AAAA,IACP,SAAAC,IAAU;AAAA,IACV,YAAAC,IAAa;AAAA,IACb,QAAAC,IAAS;AAAA,MACP,UAAU;AAAA,MACV,eAAe,CAAC;AAAA,IAClB;AAAA,IACA,kBAAAC,IAAmB;AAAA,IACnB,OAAAC;AAAA,IACA,QAAAC;AAAA,IACA,QAAAC;AAAA,IACA,SAAAC;AAAA,EACF,IAAyB,IACzB;AACA,IAAAnF,EAAI,IAAIoF,EAAe,GAGnBT,MACKU,EAAA,IAAIV,EAAK,MAAM,GACfU,EAAA,KAAKV,KAAQA,EAAK,CAAC,IAIxBC,KACFU,EAA0BV,CAAO,GAInC5E,EAAI,QAA2B,gBAAgB;AAAA,MAC7C,MAAA2E;AAAA,MACA,QAAAG;AAAA,MACA,SAAAF;AAAA,MACA,YAAAC;AAAA,MACA,kBAAAE;AAAA,IAAA,CACD,GAEGC,MAAU,MACRhF,EAAA,IAAIuF,GAAaP,CAAK,GAGxBC,MAAW,MACTjF,EAAA,IAAIwF,GAAcP,CAAM,GAG1BC,MAAW,MACTlF,EAAA,IAAIyF,GAAcP,CAAM,GAG1BC,MAAY,MACVnF,EAAA,IAAI8D,IAAeqB,CAAO;AAAA,EAElC;AACF;","x_google_ignoreList":[0]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@leaflink/stash",
|
|
3
|
-
"version": "44.
|
|
3
|
+
"version": "44.7.0",
|
|
4
4
|
"description": "LeafLink's design system.",
|
|
5
5
|
"homepage": "https://stash.leaflink.com",
|
|
6
6
|
"main": "./dist/index.ts",
|
|
@@ -92,7 +92,8 @@
|
|
|
92
92
|
"docs:spritesheet": "svg-sprite --symbol --symbol-dest=docs/public/ --symbol-sprite=spritesheet.svg --svg-namespace-ids=false assets/icons/*.svg",
|
|
93
93
|
"docs": "npm run docs:spritesheet && npm run docs:illustrations && npm run docs:logos && vitepress dev docs",
|
|
94
94
|
"docs:build": "npm run docs:spritesheet && npm run docs:illustrations && npm run docs:logos && vitepress build docs",
|
|
95
|
-
"docs:preview": "vitepress preview docs"
|
|
95
|
+
"docs:preview": "vitepress preview docs",
|
|
96
|
+
"prepare": "husky install"
|
|
96
97
|
},
|
|
97
98
|
"dependencies": {
|
|
98
99
|
"@floating-ui/vue": "^1.0.2",
|
|
@@ -138,9 +139,12 @@
|
|
|
138
139
|
"@vue/test-utils": "^2.4.1",
|
|
139
140
|
"autoprefixer": "^9.7.4",
|
|
140
141
|
"babel-core": "^7.0.0-bridge.0",
|
|
142
|
+
"doctoc": "^2.2.1",
|
|
141
143
|
"eslint": "^8.41.0",
|
|
142
144
|
"eslint-config-leaflink": "^3.3.0",
|
|
145
|
+
"husky": "^9.0.11",
|
|
143
146
|
"jsdom": "^22.1.0",
|
|
147
|
+
"lint-staged": "^15.2.2",
|
|
144
148
|
"postcss": "^8.4.35",
|
|
145
149
|
"postcss-html": "^1.5.0",
|
|
146
150
|
"postcss-prefix-selector": "^1.16.0",
|
|
@@ -177,5 +181,11 @@
|
|
|
177
181
|
"typescript": {
|
|
178
182
|
"optional": true
|
|
179
183
|
}
|
|
184
|
+
},
|
|
185
|
+
"lint-staged": {
|
|
186
|
+
"{README,CONTRIBUTING,ARCHITECTURE}.md": [
|
|
187
|
+
"prettier --write --config ./node_modules/eslint-config-leaflink/prettier.js",
|
|
188
|
+
"doctoc --title '## Table of Contents'"
|
|
189
|
+
]
|
|
180
190
|
}
|
|
181
191
|
}
|