@skeletonizer/vue 1.0.0 → 1.1.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 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:
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@skeletonizer/vue",
3
- "version": "1.0.0",
3
+ "version": "1.1.0",
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.0",
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": "1cc1b5c8a71f0f2490f555edf700c238a64df3d1"
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
- } & {};
package/dist/index.css DELETED
@@ -1 +0,0 @@
1
- [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)}}
package/dist/index.d.ts DELETED
@@ -1,4 +0,0 @@
1
- import { default as SkeletonizerSkeleton } from './components/SkeletonizerSkeleton.vue';
2
- import { SkeletonizerComponentComposable } from './composables/skeletonizer.component.composable';
3
- import { default as SkeletonizerPlugin } from './main';
4
- export { SkeletonizerSkeleton, SkeletonizerComponentComposable, SkeletonizerPlugin };
@@ -1,53 +0,0 @@
1
- import { defineComponent as m, reactive as l, watch as S, resolveDirective as u, openBlock as r, createElementBlock as s, Fragment as d, renderList as v, withDirectives as f, renderSlot as i } from "vue";
2
- import { SkeletonAdapterComponent as h, SkeletonAbstractComponent as w, SkeletonDirective as z } from "@skeletonizer/utils";
3
- const g = /* @__PURE__ */ m({
4
- __name: "SkeletonizerSkeleton",
5
- props: {
6
- config: {},
7
- showSkeleton: { type: Boolean },
8
- scope: {},
9
- colorSchema: {}
10
- },
11
- setup(n) {
12
- const e = n, t = l(new h());
13
- return S(
14
- e.config,
15
- (o) => {
16
- t.config = o, t.setupModels();
17
- },
18
- { immediate: !0 }
19
- ), (o, y) => {
20
- const a = u("skeletonize");
21
- return o.showSkeleton ? (r(!0), s(d, { key: 0 }, v(t.viewModels, (k, p) => f((r(), s("div", { key: p }, [
22
- i(o.$slots, "default", {
23
- scope: k.value
24
- })
25
- ])), [
26
- [a, e.colorSchema]
27
- ])), 128)) : i(o.$slots, "default", {
28
- key: 1,
29
- scope: e.scope
30
- });
31
- };
32
- }
33
- });
34
- class c extends w {
35
- constructor(e, t) {
36
- super(), this.skeletonConfig = e, this.showSkeleton = t;
37
- }
38
- static generate(e, t) {
39
- return l(new c(e, t));
40
- }
41
- }
42
- const B = {
43
- install: (n) => {
44
- n.component("SkeletonizerSkeleton", g), n.directive("skeletonize", (e, t) => {
45
- z.skeletonizeProjectedTemplate(e, t.value);
46
- });
47
- }
48
- };
49
- export {
50
- c as SkeletonizerComponentComposable,
51
- B as SkeletonizerPlugin,
52
- g as SkeletonizerSkeleton
53
- };
@@ -1,2 +0,0 @@
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"})});