intelliwaketssveltekitv25 0.1.98 → 0.1.99

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.
@@ -145,17 +145,18 @@ export declare const ShowActivityOverlay: Pick<Writable<number>, "subscribe"> &
145
145
  hide: () => void;
146
146
  reset: () => void;
147
147
  };
148
- export interface IMessageBoxStore {
148
+ export interface IMessageBoxStore<COLOR = string> {
149
149
  message: string | null;
150
150
  messageBody?: string | null;
151
- color?: string;
151
+ color?: COLOR;
152
152
  dismissAt?: TDateAny | null;
153
153
  }
154
- export declare const ShowMessageBox: Pick<Writable<IMessageBoxStore[]>, "subscribe"> & {
155
- show: (message: string | IMessageBoxStore) => void;
154
+ export type TStoreMessageBox<COLOR = string> = Pick<Writable<IMessageBoxStore<COLOR>[]>, 'subscribe'> & {
155
+ show: (message: string | IMessageBoxStore, color?: COLOR) => void;
156
156
  hide: (message: (string | null) | (string | null)[]) => void;
157
157
  reset: () => void;
158
158
  };
159
+ export declare const ShowMessageBox: TStoreMessageBox<string>;
159
160
  export type TChatBubblePosition = 'Right' | 'Left' | 'Top' | 'Bottom';
160
161
  export type TDropDownControlPosition = 'Right' | 'Left' | 'Center' | 'CenterForce' | null;
161
162
  export type TDropDownControlDrop = 'Up' | 'Down' | null;
@@ -38,7 +38,7 @@ const storeMessageBox = () => {
38
38
  const { subscribe, set, update } = writable([]);
39
39
  return {
40
40
  subscribe,
41
- show: (message) => update((prevState) => [
41
+ show: (message, color) => update((prevState) => [
42
42
  ...prevState.filter((pS) => pS.message !== (typeof message === 'object' ? message.message : message)),
43
43
  typeof message === 'object'
44
44
  ? {
@@ -47,7 +47,7 @@ const storeMessageBox = () => {
47
47
  ? DateParseTS('now', { seconds: 3 })
48
48
  : message.dismissAt
49
49
  }
50
- : { message: message, dismissAt: DateParseTS('now', { seconds: 3 }) }
50
+ : { message, color, dismissAt: DateParseTS('now', { seconds: 3 }) }
51
51
  ]),
52
52
  hide: (message) => update((prevState) => prevState.filter((pS) => !ToArray(message).includes(pS.message))),
53
53
  reset: () => set([])
@@ -19,14 +19,15 @@
19
19
  </script>
20
20
 
21
21
  {#each $ShowMessageBox as messageBox (messageBox.message)}
22
- <div class='w-fit max-w-[80vw] mx-auto mb-6 p-0 bg-blue-100 text-black shadow-xl rounded-lg overflow-hidden [&_*]:cursor-pointer pointer-events-auto print:hidden grid grid-cols-[2em_1fr_2em]'
22
+ <div class='messageBox w-fit max-w-[80vw] mx-auto mb-6 p-0 bg-blue-100 text-black shadow-xl rounded-lg overflow-hidden [&_*]:cursor-pointer pointer-events-auto print:hidden grid grid-cols-[2em_1fr_2em]'
23
23
  in:fly='{{ y: 200, duration: 200 }}'
24
24
  out:fade='{{ duration: 200 }}'
25
25
  role='button'
26
+ data-color={messageBox.color}
26
27
  tabindex={-1}
27
28
  onclick={() => hideMessageBox(messageBox)}
28
29
  onkeydown={() => hideMessageBox(messageBox)}>
29
- <div class='bg-blue-300 text-blue-600 flex justify-center items-center'>
30
+ <div class='messageBoxIcon bg-blue-300 text-blue-600 flex justify-center items-center'>
30
31
  <svg xmlns='http://www.w3.org/2000/svg'
31
32
  class='inline-block'
32
33
  height='16'
@@ -35,10 +36,10 @@
35
36
  <path d='M256 512A256 256 0 1 0 256 0a256 256 0 1 0 0 512zM216 336h24V272H216c-13.3 0-24-10.7-24-24s10.7-24 24-24h48c13.3 0 24 10.7 24 24v88h8c13.3 0 24 10.7 24 24s-10.7 24-24 24H216c-13.3 0-24-10.7-24-24s10.7-24 24-24zm40-208a32 32 0 1 1 0 64 32 32 0 1 1 0-64z'/>
36
37
  </svg>
37
38
  </div>
38
- <div class='py-1 px-2'>
39
+ <div class='messageBoxMessage py-1 px-2'>
39
40
  {messageBox.message}
40
41
  </div>
41
- <div class='text-center pt-1'>
42
+ <div class='messageBoxClose text-center pt-1'>
42
43
  <svg xmlns='http://www.w3.org/2000/svg'
43
44
  class='inline-block'
44
45
  height='16'
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "intelliwaketssveltekitv25",
3
- "version": "0.1.98",
3
+ "version": "0.1.99",
4
4
  "exports": {
5
5
  ".": {
6
6
  "types": "./dist/index.d.ts",