@noya-app/noya-designsystem 0.1.8 → 0.1.9
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/.turbo/turbo-build.log +7 -7
- package/CHANGELOG.md +6 -0
- package/dist/index.js +79 -0
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +79 -0
- package/dist/index.mjs.map +1 -1
- package/package.json +2 -2
package/.turbo/turbo-build.log
CHANGED
|
@@ -5,13 +5,13 @@
|
|
|
5
5
|
[34mCLI[39m Target: esnext
|
|
6
6
|
[34mCJS[39m Build start
|
|
7
7
|
[34mESM[39m Build start
|
|
8
|
-
[32mESM[39m [1mdist/index.mjs [22m[
|
|
9
|
-
[32mESM[39m [1mdist/index.mjs.map [22m[
|
|
10
|
-
[32mESM[39m ⚡️ Build success in
|
|
11
|
-
[32mCJS[39m [1mdist/index.js [22m[
|
|
12
|
-
[32mCJS[39m [1mdist/index.js.map [22m[
|
|
13
|
-
[32mCJS[39m ⚡️ Build success in
|
|
8
|
+
[32mESM[39m [1mdist/index.mjs [22m[32m185.59 KB[39m
|
|
9
|
+
[32mESM[39m [1mdist/index.mjs.map [22m[32m411.74 KB[39m
|
|
10
|
+
[32mESM[39m ⚡️ Build success in 79ms
|
|
11
|
+
[32mCJS[39m [1mdist/index.js [22m[32m201.80 KB[39m
|
|
12
|
+
[32mCJS[39m [1mdist/index.js.map [22m[32m411.93 KB[39m
|
|
13
|
+
[32mCJS[39m ⚡️ Build success in 80ms
|
|
14
14
|
[34mDTS[39m Build start
|
|
15
|
-
[32mDTS[39m ⚡️ Build success in
|
|
15
|
+
[32mDTS[39m ⚡️ Build success in 6041ms
|
|
16
16
|
[32mDTS[39m [1mdist/index.d.ts [22m[32m54.34 KB[39m
|
|
17
17
|
[32mDTS[39m [1mdist/index.d.mts [22m[32m54.34 KB[39m
|
package/CHANGELOG.md
CHANGED
package/dist/index.js
CHANGED
|
@@ -791,6 +791,85 @@ var import_react22 = require("react");
|
|
|
791
791
|
var import_noya_utils4 = require("@noya-app/noya-utils");
|
|
792
792
|
var import_react23 = require("react");
|
|
793
793
|
|
|
794
|
+
// ../emitter/src/index.ts
|
|
795
|
+
var Emitter = class {
|
|
796
|
+
constructor(options = {}) {
|
|
797
|
+
this.bufferEventsIfNoListeners = options.bufferEventsIfNoListeners ?? false;
|
|
798
|
+
}
|
|
799
|
+
bufferEventsIfNoListeners;
|
|
800
|
+
listeners = [];
|
|
801
|
+
addListener = (f, options = {}) => {
|
|
802
|
+
if (options.once) {
|
|
803
|
+
const handler = (...args) => {
|
|
804
|
+
this.removeListener(handler);
|
|
805
|
+
return f(...args);
|
|
806
|
+
};
|
|
807
|
+
this.listeners.push(handler);
|
|
808
|
+
} else {
|
|
809
|
+
this.listeners.push(f);
|
|
810
|
+
}
|
|
811
|
+
if (this.bufferedEvents.length > 0) {
|
|
812
|
+
const eventsToEmit = this.bufferedEvents;
|
|
813
|
+
this.bufferedEvents = [];
|
|
814
|
+
eventsToEmit.forEach((event) => {
|
|
815
|
+
this.emit(...event);
|
|
816
|
+
});
|
|
817
|
+
}
|
|
818
|
+
return () => this.removeListener(f);
|
|
819
|
+
};
|
|
820
|
+
removeListener = (f) => {
|
|
821
|
+
const index = this.listeners.indexOf(f);
|
|
822
|
+
if (index === -1)
|
|
823
|
+
return;
|
|
824
|
+
this.listeners.splice(index, 1);
|
|
825
|
+
};
|
|
826
|
+
emit = (...args) => {
|
|
827
|
+
if (this.bufferEventsIfNoListeners && this.listeners.length === 0) {
|
|
828
|
+
this.bufferedEvents.push(args);
|
|
829
|
+
return;
|
|
830
|
+
}
|
|
831
|
+
this.listeners.forEach((l) => l(...args));
|
|
832
|
+
};
|
|
833
|
+
bufferedEvents = [];
|
|
834
|
+
};
|
|
835
|
+
|
|
836
|
+
// ../noya-react-utils/src/utils/ClientStorage.ts
|
|
837
|
+
var ClientStorage = class {
|
|
838
|
+
getItem(storageKey) {
|
|
839
|
+
if (typeof localStorage === "undefined") {
|
|
840
|
+
return null;
|
|
841
|
+
}
|
|
842
|
+
return localStorage.getItem(storageKey);
|
|
843
|
+
}
|
|
844
|
+
setItem(storageKey, value) {
|
|
845
|
+
if (typeof localStorage === "undefined") {
|
|
846
|
+
return;
|
|
847
|
+
}
|
|
848
|
+
if (value === null) {
|
|
849
|
+
localStorage.removeItem(storageKey);
|
|
850
|
+
} else {
|
|
851
|
+
localStorage.setItem(storageKey, value);
|
|
852
|
+
}
|
|
853
|
+
this.emitter.emit(storageKey, value);
|
|
854
|
+
}
|
|
855
|
+
emitter = new Emitter();
|
|
856
|
+
_isListening = false;
|
|
857
|
+
addListener(storageKey, listener) {
|
|
858
|
+
if (!this._isListening && typeof window !== "undefined") {
|
|
859
|
+
this._isListening = true;
|
|
860
|
+
window.addEventListener("storage", (event) => {
|
|
861
|
+
this.emitter.emit(event.key, event.newValue);
|
|
862
|
+
});
|
|
863
|
+
}
|
|
864
|
+
return this.emitter.addListener((key, value) => {
|
|
865
|
+
if (key === storageKey) {
|
|
866
|
+
listener(value);
|
|
867
|
+
}
|
|
868
|
+
});
|
|
869
|
+
}
|
|
870
|
+
};
|
|
871
|
+
var clientStorage = new ClientStorage();
|
|
872
|
+
|
|
794
873
|
// ../noya-react-utils/src/utils/assignRef.ts
|
|
795
874
|
function assignRef(ref, value) {
|
|
796
875
|
if (typeof ref === "function") {
|