@egjs/svelte-conveyer
Advanced tools
Comparing version 1.4.6 to 1.4.7-beta.0
@@ -7,3 +7,3 @@ /* | ||
repository: https://github.com/naver/egjs-conveyer | ||
version: 1.4.6 | ||
version: 1.4.7-beta.0 | ||
*/ | ||
@@ -13,3 +13,5 @@ 'use strict'; | ||
var conveyer = require('@egjs/conveyer'); | ||
var svelte = require('@cfcs/svelte'); | ||
var core = require('@cfcs/core'); | ||
var internal = require('svelte/internal'); | ||
var store = require('svelte/store'); | ||
@@ -44,2 +46,92 @@ /****************************************************************************** | ||
/* | ||
Copyright (c) NAVER Corp. | ||
name: @cfcs/svelte | ||
license: MIT | ||
author: NAVER Corp. | ||
repository: https://github.com/naver/cfcs | ||
version: 0.0.12 | ||
*/ | ||
/****************************************************************************** | ||
Copyright (c) Microsoft Corporation. | ||
Permission to use, copy, modify, and/or distribute this software for any | ||
purpose with or without fee is hereby granted. | ||
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH | ||
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY | ||
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, | ||
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM | ||
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR | ||
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR | ||
PERFORMANCE OF THIS SOFTWARE. | ||
***************************************************************************** */ | ||
var __assign$1 = function () { | ||
__assign$1 = Object.assign || function __assign(t) { | ||
for (var s, i = 1, n = arguments.length; i < n; i++) { | ||
s = arguments[i]; | ||
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p]; | ||
} | ||
return t; | ||
}; | ||
return __assign$1.apply(this, arguments); | ||
}; | ||
function useRef(defaultValue) { | ||
var refFunction = function (value) { | ||
refFunction.current = value; | ||
return { | ||
destroy: function () { | ||
return; | ||
} | ||
}; | ||
}; | ||
refFunction.current = defaultValue; | ||
return refFunction; | ||
} | ||
function useReactive(reactiveProps) { | ||
var adaptResult = core.adaptReactive(reactiveProps); | ||
var reactiveState = adaptResult.state(); | ||
var writables = {}; | ||
var names = Object.keys(reactiveState); | ||
var methods = adaptResult.methods(); | ||
for (var name in reactiveState) { | ||
writables[name] = store.writable(reactiveState[name]); | ||
} | ||
internal.onMount(function () { | ||
adaptResult.mounted(); | ||
var inst = adaptResult.instance(); | ||
names.forEach(function (name) { | ||
inst.subscribe(name, function (value) { | ||
writables[name].set(value); | ||
}); | ||
}); | ||
adaptResult.init(); | ||
}); | ||
internal.onDestroy(function () { | ||
adaptResult.destroy(); | ||
}); | ||
var reactiveEvents = reactiveProps.events || []; | ||
var events = reactiveEvents.reduce(function (result, name) { | ||
result[core.camelize("on ".concat(name))] = function (callback) { | ||
internal.onMount(function () { | ||
adaptResult.on(name, callback); | ||
}); | ||
internal.onDestroy(function () { | ||
adaptResult.off(name, callback); | ||
}); | ||
}; | ||
return result; | ||
}, {}); | ||
return __assign$1(__assign$1(__assign$1({}, writables), methods), events); | ||
} | ||
function useConveyer(props) { | ||
@@ -52,4 +144,4 @@ if (props === void 0) { | ||
var elementRef = svelte.useRef(); | ||
var result = svelte.useReactive(__assign({ | ||
var elementRef = useRef(); | ||
var result = useReactive(__assign({ | ||
data: function () { | ||
@@ -72,4 +164,4 @@ return { | ||
var elementRef = svelte.useRef(); | ||
svelte.useReactive(__assign({ | ||
var elementRef = useRef(); | ||
useReactive(__assign({ | ||
data: function () { | ||
@@ -76,0 +168,0 @@ return { |
@@ -7,6 +7,8 @@ /* | ||
repository: https://github.com/naver/egjs-conveyer | ||
version: 1.4.6 | ||
version: 1.4.7-beta.0 | ||
*/ | ||
import { REACTIVE_CONVEYER } from '@egjs/conveyer'; | ||
import { useRef, useReactive } from '@cfcs/svelte'; | ||
import { adaptReactive, camelize } from '@cfcs/core'; | ||
import { onMount, onDestroy } from 'svelte/internal'; | ||
import { writable } from 'svelte/store'; | ||
@@ -41,2 +43,92 @@ /****************************************************************************** | ||
/* | ||
Copyright (c) NAVER Corp. | ||
name: @cfcs/svelte | ||
license: MIT | ||
author: NAVER Corp. | ||
repository: https://github.com/naver/cfcs | ||
version: 0.0.12 | ||
*/ | ||
/****************************************************************************** | ||
Copyright (c) Microsoft Corporation. | ||
Permission to use, copy, modify, and/or distribute this software for any | ||
purpose with or without fee is hereby granted. | ||
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH | ||
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY | ||
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, | ||
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM | ||
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR | ||
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR | ||
PERFORMANCE OF THIS SOFTWARE. | ||
***************************************************************************** */ | ||
var __assign$1 = function () { | ||
__assign$1 = Object.assign || function __assign(t) { | ||
for (var s, i = 1, n = arguments.length; i < n; i++) { | ||
s = arguments[i]; | ||
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p]; | ||
} | ||
return t; | ||
}; | ||
return __assign$1.apply(this, arguments); | ||
}; | ||
function useRef(defaultValue) { | ||
var refFunction = function (value) { | ||
refFunction.current = value; | ||
return { | ||
destroy: function () { | ||
return; | ||
} | ||
}; | ||
}; | ||
refFunction.current = defaultValue; | ||
return refFunction; | ||
} | ||
function useReactive(reactiveProps) { | ||
var adaptResult = adaptReactive(reactiveProps); | ||
var reactiveState = adaptResult.state(); | ||
var writables = {}; | ||
var names = Object.keys(reactiveState); | ||
var methods = adaptResult.methods(); | ||
for (var name in reactiveState) { | ||
writables[name] = writable(reactiveState[name]); | ||
} | ||
onMount(function () { | ||
adaptResult.mounted(); | ||
var inst = adaptResult.instance(); | ||
names.forEach(function (name) { | ||
inst.subscribe(name, function (value) { | ||
writables[name].set(value); | ||
}); | ||
}); | ||
adaptResult.init(); | ||
}); | ||
onDestroy(function () { | ||
adaptResult.destroy(); | ||
}); | ||
var reactiveEvents = reactiveProps.events || []; | ||
var events = reactiveEvents.reduce(function (result, name) { | ||
result[camelize("on ".concat(name))] = function (callback) { | ||
onMount(function () { | ||
adaptResult.on(name, callback); | ||
}); | ||
onDestroy(function () { | ||
adaptResult.off(name, callback); | ||
}); | ||
}; | ||
return result; | ||
}, {}); | ||
return __assign$1(__assign$1(__assign$1({}, writables), methods), events); | ||
} | ||
function useConveyer(props) { | ||
@@ -43,0 +135,0 @@ if (props === void 0) { |
{ | ||
"name": "@egjs/svelte-conveyer", | ||
"version": "1.4.6", | ||
"version": "1.4.7-beta.0", | ||
"description": "Svelte Conveyer adds Drag gestures to your Native Scroll.", | ||
@@ -8,2 +8,3 @@ "sideEffects": false, | ||
"module": "dist/conveyer.esm.js", | ||
"svelte": "dist/conveyer.esm.js", | ||
"main": "dist/conveyer.cjs.js", | ||
@@ -73,5 +74,5 @@ "repository": { | ||
"dependencies": { | ||
"@cfcs/svelte": "~0.0.4", | ||
"@egjs/conveyer": "~1.4.6" | ||
"@cfcs/svelte": "~0.0.12", | ||
"@egjs/conveyer": "~1.4.7-beta.0" | ||
} | ||
} |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
Shell access
Supply chain riskThis module accesses the system shell. Accessing the system shell increases the risk of executing arbitrary code.
Found 1 instance in 1 package
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 1 instance in 1 package
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
41984
24
563
1
1
2
Updated@cfcs/svelte@~0.0.12
Updated@egjs/conveyer@~1.4.7-beta.0