@skeletonizer/vue 1.0.0 → 1.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/LICENSE CHANGED
@@ -1,6 +1,6 @@
1
1
  MIT License
2
2
 
3
- Copyright (c) 2023 Luka Varga
3
+ Copyright (c) 2024 Luka Varga
4
4
 
5
5
  Permission is hereby granted, free of charge, to any person obtaining a copy
6
6
  of this software and associated documentation files (the "Software"), to deal
package/README.md CHANGED
@@ -131,9 +131,10 @@ setTimeout(() => {
131
131
  ```
132
132
 
133
133
  ### Color Scheme
134
- Generally speaking, you shouldn't need to adjust the color scheme of the skeletonized component in most cases. However, should you need to, the color scheme of the skeletonized views can be customized by providing the `:color-scheme` property to the `<skeletonizer-skeleton>`.
134
+ Generally speaking, you shouldn't need to adjust the color scheme of the skeletonized component in most cases. However, should you need to, the color scheme of the skeletonized views can be customized by providing the `:color-schema` property to the `<skeletonizer-skeleton>`.
135
+
136
+ For more details about the `:color-schema` property, see the [colorSchema](/packages/utils/README.md#colorschema) section.
135
137
 
136
- For more details about the `:color-scheme` property, see the [colorScheme](/packages/utils/README.md#colorscheme) section.
137
138
 
138
139
  ## Contributing
139
140
  For Vue adapter-specific contributions, run the following commands to get started:
@@ -1,2 +1,2 @@
1
1
  (function(t,e){typeof exports=="object"&&typeof module<"u"?e(exports,require("vue"),require("@skeletonizer/utils")):typeof define=="function"&&define.amd?define(["exports","vue","@skeletonizer/utils"],e):(t=typeof globalThis<"u"?globalThis:t||self,e(t.SkeletonizerVue={},t.Vue,t.SkeletonizerUtils))})(this,function(t,e,l){"use strict";var a=document.createElement("style");a.textContent=`[data-skeletonizer=wrapper-element]{--skeletonizer-text-background: rgba(0, 0, 0, .2);display:contents;filter:grayscale(100%);pointer-events:none}[data-skeletonizer=wrapper-element] *{pointer-events:none}[data-skeletonizer=wrapper-element] [data-skeletonizer=text]{animation:text-animation 2s infinite ease-in-out;background:var(--skeletonizer-primary-color);border-radius:50px;color:#0000!important}@keyframes text-animation{0%{background:var(--skeletonizer-primary-color)}50%{background:var(--skeletonizer-secondary-color)}to{background:var(--skeletonizer-primary-color)}}
2
- `,document.head.appendChild(a);const c=e.defineComponent({__name:"SkeletonizerSkeleton",props:{config:{},showSkeleton:{type:Boolean},scope:{},colorSchema:{}},setup(i){const n=i,o=e.reactive(new l.SkeletonAdapterComponent);return e.watch(n.config,r=>{o.config=r,o.setupModels()},{immediate:!0}),(r,u)=>{const d=e.resolveDirective("skeletonize");return r.showSkeleton?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:0},e.renderList(o.viewModels,(p,m)=>e.withDirectives((e.openBlock(),e.createElementBlock("div",{key:m},[e.renderSlot(r.$slots,"default",{scope:p.value})])),[[d,n.colorSchema]])),128)):e.renderSlot(r.$slots,"default",{key:1,scope:n.scope})}}});class s extends l.SkeletonAbstractComponent{constructor(n,o){super(),this.skeletonConfig=n,this.showSkeleton=o}static generate(n,o){return e.reactive(new s(n,o))}}const k={install:i=>{i.component("SkeletonizerSkeleton",c),i.directive("skeletonize",(n,o)=>{l.SkeletonDirective.skeletonizeProjectedTemplate(n,o.value)})}};t.SkeletonizerComponentComposable=s,t.SkeletonizerPlugin=k,t.SkeletonizerSkeleton=c,Object.defineProperty(t,Symbol.toStringTag,{value:"Module"})});
2
+ /*$vite$:1*/`,document.head.appendChild(a);const c=e.defineComponent({__name:"SkeletonizerSkeleton",props:{config:{},showSkeleton:{type:Boolean},scope:{},colorSchema:{}},setup(i){const n=i,o=e.reactive(new l.SkeletonAdapterComponent);return e.watch(n.config,r=>{o.config=r,o.setupModels()},{immediate:!0}),(r,u)=>{const d=e.resolveDirective("skeletonize");return r.showSkeleton?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:0},e.renderList(o.viewModels,(p,m)=>e.withDirectives((e.openBlock(),e.createElementBlock("div",{key:m},[e.renderSlot(r.$slots,"default",{scope:p.value})])),[[d,n.colorSchema]])),128)):e.renderSlot(r.$slots,"default",{key:1,scope:n.scope})}}});class s extends l.SkeletonAbstractComponent{constructor(n,o){super(),this.skeletonConfig=n,this.showSkeleton=o}static generate(n,o){return e.reactive(new s(n,o))}}const k={install:i=>{i.component("SkeletonizerSkeleton",c),i.directive("skeletonize",(n,o)=>{l.SkeletonDirective.skeletonizeProjectedTemplate(n,o.value)})}};t.SkeletonizerComponentComposable=s,t.SkeletonizerPlugin=k,t.SkeletonizerSkeleton=c,Object.defineProperty(t,Symbol.toStringTag,{value:"Module"})});
@@ -0,0 +1,34 @@
1
+ import { ISkeletonizerColorSchema, TSchemaConfig } from '@skeletonizer/utils';
2
+ import { UnwrapRef } from 'vue';
3
+ declare const _default: <TSkeletonScopeObject extends object>(__VLS_props: NonNullable<Awaited<typeof __VLS_setup>>["props"], __VLS_ctx?: __VLS_PrettifyLocal<Pick<NonNullable<Awaited<typeof __VLS_setup>>, "attrs" | "emit" | "slots">>, __VLS_expose?: NonNullable<Awaited<typeof __VLS_setup>>["expose"], __VLS_setup?: Promise<{
4
+ props: __VLS_PrettifyLocal<Pick<Partial<{}> & Omit<{} & import('vue').VNodeProps & import('vue').AllowedComponentProps & import('vue').ComponentCustomProps, never>, never> & {
5
+ config: TSchemaConfig<TSkeletonScopeObject>;
6
+ showSkeleton: boolean;
7
+ scope: TSkeletonScopeObject;
8
+ colorSchema?: ISkeletonizerColorSchema;
9
+ }> & import('vue').PublicProps;
10
+ expose(exposed: import('vue').ShallowUnwrapRef<{}>): void;
11
+ attrs: any;
12
+ slots: Readonly<{
13
+ default?: (props: {
14
+ scope: TSkeletonScopeObject | UnwrapRef<TSkeletonScopeObject>;
15
+ }) => {
16
+ scope: TSkeletonScopeObject | UnwrapRef<TSkeletonScopeObject>;
17
+ };
18
+ }> & {
19
+ default?: (props: {
20
+ scope: TSkeletonScopeObject | UnwrapRef<TSkeletonScopeObject>;
21
+ }) => {
22
+ scope: TSkeletonScopeObject | UnwrapRef<TSkeletonScopeObject>;
23
+ };
24
+ };
25
+ emit: {};
26
+ }>) => import('vue').VNode<import('vue').RendererNode, import('vue').RendererElement, {
27
+ [key: string]: any;
28
+ }> & {
29
+ __ctx?: Awaited<typeof __VLS_setup>;
30
+ };
31
+ export default _default;
32
+ type __VLS_PrettifyLocal<T> = {
33
+ [K in keyof T]: T[K];
34
+ } & {};
@@ -0,0 +1,8 @@
1
+ import { SkeletonAbstractComponent, TSchemaConfig } from '@skeletonizer/utils';
2
+ import { UnwrapNestedRefs } from 'vue';
3
+ export declare class SkeletonizerComponentComposable<T extends object> extends SkeletonAbstractComponent<T> {
4
+ skeletonConfig: TSchemaConfig<T>;
5
+ showSkeleton: boolean;
6
+ private constructor();
7
+ static generate<T extends object>(skeletonConfig: TSchemaConfig<T>, showSkeleton: boolean): UnwrapNestedRefs<SkeletonizerComponentComposable<T>>;
8
+ }
@@ -0,0 +1,5 @@
1
+ import { App } from 'vue';
2
+ declare const _default: {
3
+ install: (app: App) => void;
4
+ };
5
+ export default _default;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@skeletonizer/vue",
3
- "version": "1.0.0",
3
+ "version": "1.1.1",
4
4
  "description": "The way to skeletonize your Vue.js components",
5
5
  "author": "Luka Varga",
6
6
  "license": "MIT",
@@ -22,7 +22,7 @@
22
22
  ".": {
23
23
  "import": "./dist/skeletonizer-vue.mjs",
24
24
  "require": "./dist/skeletonizer-vue.umd.js",
25
- "types": "./dist/index.d.ts"
25
+ "types": "./dist/src/lib/index.d.ts"
26
26
  },
27
27
  "./dist/*.css": "./dist/*.css"
28
28
  },
@@ -46,37 +46,39 @@
46
46
  "type-check": "vue-tsc --noEmit -p tsconfig.vitest.json --composite false",
47
47
  "style-lint": "stylelint '**/*.?(css|scss|vue)' --color",
48
48
  "style-lintfix": "stylelint '**/*.?(css|scss|vue)' --color --fix",
49
- "lint": "eslint --ext .ts,.vue,.js src/ && npm run style-lint",
50
- "lintfix": "npm run style-lintfix && eslint --ext .ts,.vue,.js src/ --fix",
49
+ "lint": "eslint src/ && npm run style-lint",
50
+ "lintfix": "npm run style-lintfix && eslint src/ --fix",
51
51
  "lint-staged": "lint-staged"
52
52
  },
53
53
  "peerDependencies": {
54
+ "@skeletonizer/utils": "^1.1.0",
54
55
  "vue": "^3.3.4"
55
56
  },
56
57
  "devDependencies": {
58
+ "@skeletonizer/utils": "^1.1.1",
57
59
  "@tsconfig/node18": "^2.0.1",
58
- "@types/jsdom": "^21.1.6",
59
- "@types/node": "^20.12.3",
60
+ "@types/jsdom": "^21.1.7",
61
+ "@types/node": "^20.17.5",
60
62
  "@vitejs/plugin-vue": "^5.1.4",
61
- "@vitest/browser": "2.1.2",
63
+ "@vitest/browser": "2.1.4",
62
64
  "@vue/test-utils": "^2.4.6",
63
65
  "@vue/tsconfig": "^0.5.1",
64
- "eslint-plugin-vue": "^9.24.0",
65
- "jsdom": "^24.0.0",
66
+ "eslint-plugin-vue": "^9.30.0",
67
+ "jsdom": "^25.0.1",
66
68
  "npm-run-all": "^4.1.5",
67
- "sass": "^1.72.0",
68
- "typescript": "^5.4.3",
69
- "vite": "^5.4.8",
70
- "vite-plugin-dts": "^4.2.3",
71
- "vitest": "2.1.2",
72
- "vue": "^3.5.11",
73
- "vue-eslint-parser": "^9.4.2",
74
- "vue-tsc": "^2.1.6",
75
- "webdriverio": "^9.1.2"
69
+ "sass": "^1.80.5",
70
+ "typescript": "~5.5.4",
71
+ "vite": "^5.4.10",
72
+ "vite-plugin-dts": "^4.3.0",
73
+ "vitest": "2.1.4",
74
+ "vue": "^3.5.12",
75
+ "vue-eslint-parser": "^9.4.3",
76
+ "vue-tsc": "^2.1.10",
77
+ "webdriverio": "^9.2.8"
76
78
  },
77
79
  "lint-staged": {
78
80
  "**/*.{scss,css}": "stylelint --fix",
79
81
  "**/*.{ts,js,.vue}": "eslint --fix"
80
82
  },
81
- "gitHead": "b991aef461188aebee063efb7df47e70c58b0772"
83
+ "gitHead": "a0b3a5c3b3d12cec97f9bf22830437ce1166c2a3"
82
84
  }
@@ -1,78 +0,0 @@
1
- import { ISkeletonizerColorSchema, TSchemaConfig } from '@skeletonizer/utils';
2
- import { UnwrapRef } from 'vue';
3
- declare const _default: <TSkeletonScopeObject extends object>(__VLS_props: {
4
- config: TSchemaConfig<TSkeletonScopeObject>;
5
- showSkeleton: boolean;
6
- scope: TSkeletonScopeObject;
7
- colorSchema?: ISkeletonizerColorSchema | undefined;
8
- } & import('vue').VNodeProps & import('vue').AllowedComponentProps & import('vue').ComponentCustomProps, __VLS_ctx?: {
9
- slots: Readonly<{
10
- default?: ((props: {
11
- scope: TSkeletonScopeObject | UnwrapRef<TSkeletonScopeObject>;
12
- }) => {
13
- scope: TSkeletonScopeObject | UnwrapRef<TSkeletonScopeObject>;
14
- }) | undefined;
15
- }> & {
16
- default?: ((props: {
17
- scope: TSkeletonScopeObject | UnwrapRef<TSkeletonScopeObject>;
18
- }) => {
19
- scope: TSkeletonScopeObject | UnwrapRef<TSkeletonScopeObject>;
20
- }) | undefined;
21
- };
22
- attrs: any;
23
- emit: {};
24
- } | undefined, __VLS_expose?: ((exposed: import('vue').ShallowUnwrapRef<{}>) => void) | undefined, __VLS_setup?: Promise<{
25
- props: {
26
- config: TSchemaConfig<TSkeletonScopeObject>;
27
- showSkeleton: boolean;
28
- scope: TSkeletonScopeObject;
29
- colorSchema?: ISkeletonizerColorSchema | undefined;
30
- } & import('vue').VNodeProps & import('vue').AllowedComponentProps & import('vue').ComponentCustomProps;
31
- expose(exposed: import('vue').ShallowUnwrapRef<{}>): void;
32
- attrs: any;
33
- slots: Readonly<{
34
- default?: ((props: {
35
- scope: TSkeletonScopeObject | UnwrapRef<TSkeletonScopeObject>;
36
- }) => {
37
- scope: TSkeletonScopeObject | UnwrapRef<TSkeletonScopeObject>;
38
- }) | undefined;
39
- }> & {
40
- default?: ((props: {
41
- scope: TSkeletonScopeObject | UnwrapRef<TSkeletonScopeObject>;
42
- }) => {
43
- scope: TSkeletonScopeObject | UnwrapRef<TSkeletonScopeObject>;
44
- }) | undefined;
45
- };
46
- emit: {};
47
- }>) => import('vue').VNode<import('vue').RendererNode, import('vue').RendererElement, {
48
- [key: string]: any;
49
- }> & {
50
- __ctx?: {
51
- props: {
52
- config: TSchemaConfig<TSkeletonScopeObject>;
53
- showSkeleton: boolean;
54
- scope: TSkeletonScopeObject;
55
- colorSchema?: ISkeletonizerColorSchema | undefined;
56
- } & import('vue').VNodeProps & import('vue').AllowedComponentProps & import('vue').ComponentCustomProps;
57
- expose(exposed: import('vue').ShallowUnwrapRef<{}>): void;
58
- attrs: any;
59
- slots: Readonly<{
60
- default?: ((props: {
61
- scope: TSkeletonScopeObject | UnwrapRef<TSkeletonScopeObject>;
62
- }) => {
63
- scope: TSkeletonScopeObject | UnwrapRef<TSkeletonScopeObject>;
64
- }) | undefined;
65
- }> & {
66
- default?: ((props: {
67
- scope: TSkeletonScopeObject | UnwrapRef<TSkeletonScopeObject>;
68
- }) => {
69
- scope: TSkeletonScopeObject | UnwrapRef<TSkeletonScopeObject>;
70
- }) | undefined;
71
- };
72
- emit: {};
73
- } | undefined;
74
- };
75
- export default _default;
76
- type __VLS_PrettifyLocal<T> = {
77
- [K in keyof T]: T[K];
78
- } & {};
File without changes