@openk9ui/openk9-chatbot 3.0.1 → 3.1.0-SNAPSHOT

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.
@@ -10402,7 +10402,8 @@ function unstable_createStyleFunctionSx() {
10402
10402
  function styleFunctionSx2(props) {
10403
10403
  const {
10404
10404
  sx,
10405
- theme = {}
10405
+ theme = {},
10406
+ nested
10406
10407
  } = props || {};
10407
10408
  if (!sx) {
10408
10409
  return null;
@@ -10436,7 +10437,8 @@ function unstable_createStyleFunctionSx() {
10436
10437
  if (objectsHaveSameKeys(breakpointsValues, value)) {
10437
10438
  css[styleKey] = styleFunctionSx2({
10438
10439
  sx: value,
10439
- theme
10440
+ theme,
10441
+ nested: true
10440
10442
  });
10441
10443
  } else {
10442
10444
  css = merge(css, breakpointsValues);
@@ -10447,6 +10449,11 @@ function unstable_createStyleFunctionSx() {
10447
10449
  }
10448
10450
  }
10449
10451
  });
10452
+ if (!nested && theme.modularCssLayers) {
10453
+ return {
10454
+ "@layer sx": sortContainerQueries(theme, removeUnusedBreakpoints(breakpointsKeys, css))
10455
+ };
10456
+ }
10450
10457
  return sortContainerQueries(theme, removeUnusedBreakpoints(breakpointsKeys, css));
10451
10458
  }
10452
10459
  return Array.isArray(sx) ? sx.map(traverse) : traverse(sx);
@@ -11263,7 +11270,7 @@ function serializeStyles(args, registered, mergedProps) {
11263
11270
  };
11264
11271
  }
11265
11272
  /**
11266
- * @mui/styled-engine v6.4.11
11273
+ * @mui/styled-engine v6.5.0
11267
11274
  *
11268
11275
  * @license MIT
11269
11276
  * This source code is licensed under the MIT license found in the
@@ -11340,6 +11347,168 @@ function useDefaultProps$1({
11340
11347
  }
11341
11348
  });
11342
11349
  }
11350
+ const sortBreakpointsValues = (values2) => {
11351
+ const breakpointsAsArray = Object.keys(values2).map((key) => ({
11352
+ key,
11353
+ val: values2[key]
11354
+ })) || [];
11355
+ breakpointsAsArray.sort((breakpoint1, breakpoint2) => breakpoint1.val - breakpoint2.val);
11356
+ return breakpointsAsArray.reduce((acc, obj) => {
11357
+ return {
11358
+ ...acc,
11359
+ [obj.key]: obj.val
11360
+ };
11361
+ }, {});
11362
+ };
11363
+ function createBreakpoints(breakpoints) {
11364
+ const {
11365
+ // The breakpoint **start** at this value.
11366
+ // For instance with the first breakpoint xs: [xs, sm).
11367
+ values: values2 = {
11368
+ xs: 0,
11369
+ // phone
11370
+ sm: 600,
11371
+ // tablet
11372
+ md: 900,
11373
+ // small laptop
11374
+ lg: 1200,
11375
+ // desktop
11376
+ xl: 1536
11377
+ // large screen
11378
+ },
11379
+ unit = "px",
11380
+ step = 5,
11381
+ ...other
11382
+ } = breakpoints;
11383
+ const sortedValues = sortBreakpointsValues(values2);
11384
+ const keys2 = Object.keys(sortedValues);
11385
+ function up(key) {
11386
+ const value = typeof values2[key] === "number" ? values2[key] : key;
11387
+ return `@media (min-width:${value}${unit})`;
11388
+ }
11389
+ function down(key) {
11390
+ const value = typeof values2[key] === "number" ? values2[key] : key;
11391
+ return `@media (max-width:${value - step / 100}${unit})`;
11392
+ }
11393
+ function between(start, end) {
11394
+ const endIndex = keys2.indexOf(end);
11395
+ return `@media (min-width:${typeof values2[start] === "number" ? values2[start] : start}${unit}) and (max-width:${(endIndex !== -1 && typeof values2[keys2[endIndex]] === "number" ? values2[keys2[endIndex]] : end) - step / 100}${unit})`;
11396
+ }
11397
+ function only(key) {
11398
+ if (keys2.indexOf(key) + 1 < keys2.length) {
11399
+ return between(key, keys2[keys2.indexOf(key) + 1]);
11400
+ }
11401
+ return up(key);
11402
+ }
11403
+ function not(key) {
11404
+ const keyIndex = keys2.indexOf(key);
11405
+ if (keyIndex === 0) {
11406
+ return up(keys2[1]);
11407
+ }
11408
+ if (keyIndex === keys2.length - 1) {
11409
+ return down(keys2[keyIndex]);
11410
+ }
11411
+ return between(key, keys2[keys2.indexOf(key) + 1]).replace("@media", "@media not all and");
11412
+ }
11413
+ return {
11414
+ keys: keys2,
11415
+ values: sortedValues,
11416
+ up,
11417
+ down,
11418
+ between,
11419
+ only,
11420
+ not,
11421
+ unit,
11422
+ ...other
11423
+ };
11424
+ }
11425
+ const shape = {
11426
+ borderRadius: 4
11427
+ };
11428
+ function createSpacing(spacingInput = 8, transform = createUnarySpacing({
11429
+ spacing: spacingInput
11430
+ })) {
11431
+ if (spacingInput.mui) {
11432
+ return spacingInput;
11433
+ }
11434
+ const spacing = (...argsInput) => {
11435
+ if (process.env.NODE_ENV !== "production") {
11436
+ if (!(argsInput.length <= 4)) {
11437
+ console.error(`MUI: Too many arguments provided, expected between 0 and 4, got ${argsInput.length}`);
11438
+ }
11439
+ }
11440
+ const args = argsInput.length === 0 ? [1] : argsInput;
11441
+ return args.map((argument) => {
11442
+ const output = transform(argument);
11443
+ return typeof output === "number" ? `${output}px` : output;
11444
+ }).join(" ");
11445
+ };
11446
+ spacing.mui = true;
11447
+ return spacing;
11448
+ }
11449
+ function applyStyles(key, styles) {
11450
+ var _a;
11451
+ const theme = this;
11452
+ if (theme.vars) {
11453
+ if (!((_a = theme.colorSchemes) == null ? void 0 : _a[key]) || typeof theme.getColorSchemeSelector !== "function") {
11454
+ return {};
11455
+ }
11456
+ let selector = theme.getColorSchemeSelector(key);
11457
+ if (selector === "&") {
11458
+ return styles;
11459
+ }
11460
+ if (selector.includes("data-") || selector.includes(".")) {
11461
+ selector = `*:where(${selector.replace(/\s*&$/, "")}) &`;
11462
+ }
11463
+ return {
11464
+ [selector]: styles
11465
+ };
11466
+ }
11467
+ if (theme.palette.mode === key) {
11468
+ return styles;
11469
+ }
11470
+ return {};
11471
+ }
11472
+ function createTheme$1(options = {}, ...args) {
11473
+ const {
11474
+ breakpoints: breakpointsInput = {},
11475
+ palette: paletteInput = {},
11476
+ spacing: spacingInput,
11477
+ shape: shapeInput = {},
11478
+ ...other
11479
+ } = options;
11480
+ const breakpoints = createBreakpoints(breakpointsInput);
11481
+ const spacing = createSpacing(spacingInput);
11482
+ let muiTheme = deepmerge({
11483
+ breakpoints,
11484
+ direction: "ltr",
11485
+ components: {},
11486
+ // Inject component definitions.
11487
+ palette: {
11488
+ mode: "light",
11489
+ ...paletteInput
11490
+ },
11491
+ spacing,
11492
+ shape: {
11493
+ ...shape,
11494
+ ...shapeInput
11495
+ }
11496
+ }, other);
11497
+ muiTheme = cssContainerQueries(muiTheme);
11498
+ muiTheme.applyStyles = applyStyles;
11499
+ muiTheme = args.reduce((acc, argument) => deepmerge(acc, argument), muiTheme);
11500
+ muiTheme.unstable_sxConfig = {
11501
+ ...defaultSxConfig,
11502
+ ...other == null ? void 0 : other.unstable_sxConfig
11503
+ };
11504
+ muiTheme.unstable_sx = function sx(props) {
11505
+ return styleFunctionSx({
11506
+ sx: props,
11507
+ theme: this
11508
+ });
11509
+ };
11510
+ return muiTheme;
11511
+ }
11343
11512
  const assignNestedKeys = (obj, keys2, value, arrayKeys = []) => {
11344
11513
  let temp = obj;
11345
11514
  keys2.forEach((k, index2) => {
@@ -11603,168 +11772,6 @@ function createGetColorSchemeSelector(selector) {
11603
11772
  return "&";
11604
11773
  };
11605
11774
  }
11606
- const sortBreakpointsValues = (values2) => {
11607
- const breakpointsAsArray = Object.keys(values2).map((key) => ({
11608
- key,
11609
- val: values2[key]
11610
- })) || [];
11611
- breakpointsAsArray.sort((breakpoint1, breakpoint2) => breakpoint1.val - breakpoint2.val);
11612
- return breakpointsAsArray.reduce((acc, obj) => {
11613
- return {
11614
- ...acc,
11615
- [obj.key]: obj.val
11616
- };
11617
- }, {});
11618
- };
11619
- function createBreakpoints(breakpoints) {
11620
- const {
11621
- // The breakpoint **start** at this value.
11622
- // For instance with the first breakpoint xs: [xs, sm).
11623
- values: values2 = {
11624
- xs: 0,
11625
- // phone
11626
- sm: 600,
11627
- // tablet
11628
- md: 900,
11629
- // small laptop
11630
- lg: 1200,
11631
- // desktop
11632
- xl: 1536
11633
- // large screen
11634
- },
11635
- unit = "px",
11636
- step = 5,
11637
- ...other
11638
- } = breakpoints;
11639
- const sortedValues = sortBreakpointsValues(values2);
11640
- const keys2 = Object.keys(sortedValues);
11641
- function up(key) {
11642
- const value = typeof values2[key] === "number" ? values2[key] : key;
11643
- return `@media (min-width:${value}${unit})`;
11644
- }
11645
- function down(key) {
11646
- const value = typeof values2[key] === "number" ? values2[key] : key;
11647
- return `@media (max-width:${value - step / 100}${unit})`;
11648
- }
11649
- function between(start, end) {
11650
- const endIndex = keys2.indexOf(end);
11651
- return `@media (min-width:${typeof values2[start] === "number" ? values2[start] : start}${unit}) and (max-width:${(endIndex !== -1 && typeof values2[keys2[endIndex]] === "number" ? values2[keys2[endIndex]] : end) - step / 100}${unit})`;
11652
- }
11653
- function only(key) {
11654
- if (keys2.indexOf(key) + 1 < keys2.length) {
11655
- return between(key, keys2[keys2.indexOf(key) + 1]);
11656
- }
11657
- return up(key);
11658
- }
11659
- function not(key) {
11660
- const keyIndex = keys2.indexOf(key);
11661
- if (keyIndex === 0) {
11662
- return up(keys2[1]);
11663
- }
11664
- if (keyIndex === keys2.length - 1) {
11665
- return down(keys2[keyIndex]);
11666
- }
11667
- return between(key, keys2[keys2.indexOf(key) + 1]).replace("@media", "@media not all and");
11668
- }
11669
- return {
11670
- keys: keys2,
11671
- values: sortedValues,
11672
- up,
11673
- down,
11674
- between,
11675
- only,
11676
- not,
11677
- unit,
11678
- ...other
11679
- };
11680
- }
11681
- const shape = {
11682
- borderRadius: 4
11683
- };
11684
- function createSpacing(spacingInput = 8, transform = createUnarySpacing({
11685
- spacing: spacingInput
11686
- })) {
11687
- if (spacingInput.mui) {
11688
- return spacingInput;
11689
- }
11690
- const spacing = (...argsInput) => {
11691
- if (process.env.NODE_ENV !== "production") {
11692
- if (!(argsInput.length <= 4)) {
11693
- console.error(`MUI: Too many arguments provided, expected between 0 and 4, got ${argsInput.length}`);
11694
- }
11695
- }
11696
- const args = argsInput.length === 0 ? [1] : argsInput;
11697
- return args.map((argument) => {
11698
- const output = transform(argument);
11699
- return typeof output === "number" ? `${output}px` : output;
11700
- }).join(" ");
11701
- };
11702
- spacing.mui = true;
11703
- return spacing;
11704
- }
11705
- function applyStyles(key, styles) {
11706
- var _a;
11707
- const theme = this;
11708
- if (theme.vars) {
11709
- if (!((_a = theme.colorSchemes) == null ? void 0 : _a[key]) || typeof theme.getColorSchemeSelector !== "function") {
11710
- return {};
11711
- }
11712
- let selector = theme.getColorSchemeSelector(key);
11713
- if (selector === "&") {
11714
- return styles;
11715
- }
11716
- if (selector.includes("data-") || selector.includes(".")) {
11717
- selector = `*:where(${selector.replace(/\s*&$/, "")}) &`;
11718
- }
11719
- return {
11720
- [selector]: styles
11721
- };
11722
- }
11723
- if (theme.palette.mode === key) {
11724
- return styles;
11725
- }
11726
- return {};
11727
- }
11728
- function createTheme$1(options = {}, ...args) {
11729
- const {
11730
- breakpoints: breakpointsInput = {},
11731
- palette: paletteInput = {},
11732
- spacing: spacingInput,
11733
- shape: shapeInput = {},
11734
- ...other
11735
- } = options;
11736
- const breakpoints = createBreakpoints(breakpointsInput);
11737
- const spacing = createSpacing(spacingInput);
11738
- let muiTheme = deepmerge({
11739
- breakpoints,
11740
- direction: "ltr",
11741
- components: {},
11742
- // Inject component definitions.
11743
- palette: {
11744
- mode: "light",
11745
- ...paletteInput
11746
- },
11747
- spacing,
11748
- shape: {
11749
- ...shape,
11750
- ...shapeInput
11751
- }
11752
- }, other);
11753
- muiTheme = cssContainerQueries(muiTheme);
11754
- muiTheme.applyStyles = applyStyles;
11755
- muiTheme = args.reduce((acc, argument) => deepmerge(acc, argument), muiTheme);
11756
- muiTheme.unstable_sxConfig = {
11757
- ...defaultSxConfig,
11758
- ...other == null ? void 0 : other.unstable_sxConfig
11759
- };
11760
- muiTheme.unstable_sx = function sx(props) {
11761
- return styleFunctionSx({
11762
- sx: props,
11763
- theme: this
11764
- });
11765
- };
11766
- return muiTheme;
11767
- }
11768
11775
  function createMixins(breakpoints, mixins) {
11769
11776
  return {
11770
11777
  toolbar: {
@@ -12636,6 +12643,12 @@ const systemDefaultTheme = createTheme$1();
12636
12643
  function shouldForwardProp(prop) {
12637
12644
  return prop !== "ownerState" && prop !== "theme" && prop !== "sx" && prop !== "as";
12638
12645
  }
12646
+ function shallowLayer(serialized, layerName) {
12647
+ if (layerName && serialized && typeof serialized === "object" && serialized.styles && !serialized.styles.startsWith("@layer")) {
12648
+ serialized.styles = `@layer ${layerName}{${String(serialized.styles)}}`;
12649
+ }
12650
+ return serialized;
12651
+ }
12639
12652
  function defaultOverridesResolver(slot) {
12640
12653
  if (!slot) {
12641
12654
  return null;
@@ -12645,30 +12658,30 @@ function defaultOverridesResolver(slot) {
12645
12658
  function attachTheme(props, themeId, defaultTheme2) {
12646
12659
  props.theme = isObjectEmpty(props.theme) ? defaultTheme2 : props.theme[themeId] || props.theme;
12647
12660
  }
12648
- function processStyle(props, style2) {
12661
+ function processStyle(props, style2, layerName) {
12649
12662
  const resolvedStyle = typeof style2 === "function" ? style2(props) : style2;
12650
12663
  if (Array.isArray(resolvedStyle)) {
12651
- return resolvedStyle.flatMap((subStyle) => processStyle(props, subStyle));
12664
+ return resolvedStyle.flatMap((subStyle) => processStyle(props, subStyle, layerName));
12652
12665
  }
12653
12666
  if (Array.isArray(resolvedStyle == null ? void 0 : resolvedStyle.variants)) {
12654
12667
  let rootStyle;
12655
12668
  if (resolvedStyle.isProcessed) {
12656
- rootStyle = resolvedStyle.style;
12669
+ rootStyle = layerName ? shallowLayer(resolvedStyle.style, layerName) : resolvedStyle.style;
12657
12670
  } else {
12658
12671
  const {
12659
12672
  variants,
12660
12673
  ...otherStyles
12661
12674
  } = resolvedStyle;
12662
- rootStyle = otherStyles;
12675
+ rootStyle = layerName ? shallowLayer(internal_serializeStyles(otherStyles), layerName) : otherStyles;
12663
12676
  }
12664
- return processStyleVariants(props, resolvedStyle.variants, [rootStyle]);
12677
+ return processStyleVariants(props, resolvedStyle.variants, [rootStyle], layerName);
12665
12678
  }
12666
12679
  if (resolvedStyle == null ? void 0 : resolvedStyle.isProcessed) {
12667
- return resolvedStyle.style;
12680
+ return layerName ? shallowLayer(internal_serializeStyles(resolvedStyle.style), layerName) : resolvedStyle.style;
12668
12681
  }
12669
- return resolvedStyle;
12682
+ return layerName ? shallowLayer(internal_serializeStyles(resolvedStyle), layerName) : resolvedStyle;
12670
12683
  }
12671
- function processStyleVariants(props, variants, results = []) {
12684
+ function processStyleVariants(props, variants, results = [], layerName = void 0) {
12672
12685
  var _a;
12673
12686
  let mergedState;
12674
12687
  variantLoop: for (let i = 0; i < variants.length; i += 1) {
@@ -12695,9 +12708,9 @@ function processStyleVariants(props, variants, results = []) {
12695
12708
  ...props.ownerState,
12696
12709
  ownerState: props.ownerState
12697
12710
  });
12698
- results.push(variant.style(mergedState));
12711
+ results.push(layerName ? shallowLayer(internal_serializeStyles(variant.style(mergedState)), layerName) : variant.style(mergedState));
12699
12712
  } else {
12700
- results.push(variant.style);
12713
+ results.push(layerName ? shallowLayer(internal_serializeStyles(variant.style), layerName) : variant.style);
12701
12714
  }
12702
12715
  }
12703
12716
  return results;
@@ -12724,6 +12737,7 @@ function createStyled(input = {}) {
12724
12737
  overridesResolver = defaultOverridesResolver(lowercaseFirstLetter(componentSlot)),
12725
12738
  ...options
12726
12739
  } = inputOptions;
12740
+ const layerName = componentName && componentName.startsWith("Mui") || !!componentSlot ? "components" : "custom";
12727
12741
  const skipVariantsResolver = inputSkipVariantsResolver !== void 0 ? inputSkipVariantsResolver : (
12728
12742
  // TODO v6: remove `Root` in the next major release
12729
12743
  // For more details: https://github.com/mui/material-ui/pull/37908
@@ -12749,16 +12763,16 @@ function createStyled(input = {}) {
12749
12763
  }
12750
12764
  if (typeof style2 === "function") {
12751
12765
  return function styleFunctionProcessor(props) {
12752
- return processStyle(props, style2);
12766
+ return processStyle(props, style2, props.theme.modularCssLayers ? layerName : void 0);
12753
12767
  };
12754
12768
  }
12755
12769
  if (isPlainObject(style2)) {
12756
12770
  const serialized = preprocessStyles(style2);
12757
- if (!serialized.variants) {
12758
- return serialized.style;
12759
- }
12760
12771
  return function styleObjectProcessor(props) {
12761
- return processStyle(props, serialized);
12772
+ if (!serialized.variants) {
12773
+ return props.theme.modularCssLayers ? shallowLayer(serialized.style, layerName) : serialized.style;
12774
+ }
12775
+ return processStyle(props, serialized, props.theme.modularCssLayers ? layerName : void 0);
12762
12776
  };
12763
12777
  }
12764
12778
  return style2;
@@ -12778,7 +12792,7 @@ function createStyled(input = {}) {
12778
12792
  }
12779
12793
  const resolvedStyleOverrides = {};
12780
12794
  for (const slotKey in styleOverrides) {
12781
- resolvedStyleOverrides[slotKey] = processStyle(props, styleOverrides[slotKey]);
12795
+ resolvedStyleOverrides[slotKey] = processStyle(props, styleOverrides[slotKey], props.theme.modularCssLayers ? "theme" : void 0);
12782
12796
  }
12783
12797
  return overridesResolver(props, resolvedStyleOverrides);
12784
12798
  });
@@ -12791,7 +12805,7 @@ function createStyled(input = {}) {
12791
12805
  if (!themeVariants) {
12792
12806
  return null;
12793
12807
  }
12794
- return processStyleVariants(props, themeVariants);
12808
+ return processStyleVariants(props, themeVariants, [], props.theme.modularCssLayers ? "theme" : void 0);
12795
12809
  });
12796
12810
  }
12797
12811
  if (!skipSx) {
@@ -3,7 +3,7 @@ import { ThemeProvider, useTheme, Box, Button, IconButton } from "@mui/material"
3
3
  import React__default from "react";
4
4
  import Search from "./Search.js";
5
5
  import useGenerateResponse from "./useGenerateResponse.js";
6
- import { c as createTheme, S as SingleMessage } from "../SingleMessage-Dyc7W2JZ.js";
6
+ import { c as createTheme, S as SingleMessage } from "../SingleMessage-D59l6K_M.js";
7
7
  import { useFocusTrap } from "./useFocusTrap.js";
8
8
  import { Translate } from "./Translate.js";
9
9
  import { LanguageProvider } from "./LanguageContext.js";
@@ -2,7 +2,7 @@ import "react/jsx-runtime";
2
2
  import "@emotion/styled";
3
3
  import "@mui/material";
4
4
  import "./Translate.js";
5
- import { S } from "../SingleMessage-Dyc7W2JZ.js";
5
+ import { S } from "../SingleMessage-D59l6K_M.js";
6
6
  import "react";
7
7
  export {
8
8
  S as SingleMessage
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@openk9ui/openk9-chatbot",
3
3
  "private": false,
4
- "version": "3.0.1",
4
+ "version": "3.1.0-SNAPSHOT",
5
5
  "license": "MIT",
6
6
  "type": "module",
7
7
  "main": "dist/main.js",
@@ -17,7 +17,7 @@
17
17
  },
18
18
  "peerDependencies": {
19
19
  "@emotion/react": "^11.13.3",
20
- "@emotion/styled": "^11.13.0",
20
+ "@emotion/styled": "^5.1.14",
21
21
  "@fontsource/roboto": "^5.1.0",
22
22
  "@fontsource/titillium-web": "^5.1.0",
23
23
  "@mui/material": "^6.1.6",
@@ -27,16 +27,16 @@
27
27
  "react": "^18.0.0",
28
28
  "react-dom": "^18.0.0",
29
29
  "react-markdown": "^9.0.1",
30
- "styled-components": "^6.1.13",
30
+ "styled-components": "^5.1.14",
31
+ "@types/react": "^18.3.12",
32
+ "@types/styled-components": "^5.1.14",
33
+ "@types/react-dom": "^18.3.1",
31
34
  "uuid": "^11.0.2"
32
35
  },
33
36
  "devDependencies": {
34
37
  "@eslint/js": "^9.13.0",
35
38
  "@rollup/plugin-commonjs": "^28.0.1",
36
39
  "@types/node": "^22.8.6",
37
- "@types/react": "^18.3.12",
38
- "@types/react-dom": "^18.3.1",
39
- "@types/styled-components": "^5.1.34",
40
40
  "@types/uuid": "^10.0.0",
41
41
  "@vitejs/plugin-react": "^4.3.3",
42
42
  "eslint": "^9.13.0",
@@ -50,8 +50,6 @@
50
50
  "vite": "^5.4.10",
51
51
  "vite-plugin-commonjs": "^0.10.3",
52
52
  "vite-plugin-dts": "^4.3.0",
53
- "@fontsource/roboto": "^5.1.0",
54
- "@fontsource/titillium-web": "^5.1.0",
55
53
  "vite-plugin-lib-inject-css": "^2.1.1"
56
54
  },
57
55
  "resolutions": {