@owp/core 1.28.0 → 1.30.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.
Files changed (94) hide show
  1. package/dist/{Close-DnXhM4Ms.js → Close-DnXyQZKh.js} +435 -378
  2. package/dist/Close-DnXyQZKh.js.map +1 -0
  3. package/dist/OwpStoreProvider-Bx5p7ooQ.js +30 -0
  4. package/dist/OwpStoreProvider-Bx5p7ooQ.js.map +1 -0
  5. package/dist/{OwpUtils-9lHSCdan.js → OwpUtils-C81bM1Gz.js} +2 -2
  6. package/dist/OwpUtils-C81bM1Gz.js.map +1 -0
  7. package/dist/{QuickPanel-BOgEYOAw.js → QuickPanel-CO7Tyc8C.js} +2 -2
  8. package/dist/{QuickPanel-BOgEYOAw.js.map → QuickPanel-CO7Tyc8C.js.map} +1 -1
  9. package/dist/colors.js +3 -18
  10. package/dist/colors.js.map +1 -1
  11. package/dist/constants.js +17 -20
  12. package/dist/constants.js.map +1 -1
  13. package/dist/context.js +64 -36
  14. package/dist/context.js.map +1 -1
  15. package/dist/hooks.js +70 -70
  16. package/dist/hooks.js.map +1 -1
  17. package/dist/{index-B8tZAW8i.js → index-KlA5Es4t.js} +11931 -12745
  18. package/dist/index-KlA5Es4t.js.map +1 -0
  19. package/dist/index.js +88 -115
  20. package/dist/{isTypedArray-xp-fB7W4.js → isTypedArray-DPyC49cI.js} +3 -3
  21. package/dist/{isTypedArray-xp-fB7W4.js.map → isTypedArray-DPyC49cI.js.map} +1 -1
  22. package/dist/{lazyLoadedSlices-BAbcXcEU.js → lazyLoadedSlices-DC7yg4GT.js} +885 -845
  23. package/dist/lazyLoadedSlices-DC7yg4GT.js.map +1 -0
  24. package/dist/localStorageKeys-Che0CNci.js +10 -0
  25. package/dist/localStorageKeys-Che0CNci.js.map +1 -0
  26. package/dist/owp-app.css +1 -1
  27. package/dist/owpDark-DAY0F6Ph.js +21 -0
  28. package/dist/owpDark-DAY0F6Ph.js.map +1 -0
  29. package/dist/storageKeys-C6xHFiTo.js +42 -0
  30. package/dist/storageKeys-C6xHFiTo.js.map +1 -0
  31. package/dist/store.js +37 -3
  32. package/dist/store.js.map +1 -1
  33. package/dist/{toUpper-CilZrxEa.js → toUpper-i_I6Tyuv.js} +2 -2
  34. package/dist/{toUpper-CilZrxEa.js.map → toUpper-i_I6Tyuv.js.map} +1 -1
  35. package/dist/treeGrid-DtKg-9uf.js +8 -0
  36. package/dist/treeGrid-DtKg-9uf.js.map +1 -0
  37. package/dist/{treeGridUtil-_FDvRzzt.js → treeGridUtil-WTM_djsN.js} +62 -61
  38. package/dist/{treeGridUtil-_FDvRzzt.js.map → treeGridUtil-WTM_djsN.js.map} +1 -1
  39. package/dist/types/components/OwpErrorBoundary/OwpErrorBoundary.d.ts +1 -1
  40. package/dist/types/components/OwpLayout/OwpLayout.d.ts +1 -1
  41. package/dist/types/components/OwpTable/OwpTable.d.ts +1 -1
  42. package/dist/types/components/OwpTabs/OwpTab.d.ts +1 -1
  43. package/dist/types/components/OwpTabs/OwpTabs.d.ts +1 -1
  44. package/dist/types/components/OwpThemeSelector/SchemePreview.d.ts +1 -1
  45. package/dist/types/components/OwpThemeSelector/ThemePreview.d.ts +1 -1
  46. package/dist/types/components/layouts/shared-components/navigation/store/navigationSlice.d.ts +5 -5
  47. package/dist/types/components/layouts/themeLayoutConfigs.d.ts +1 -1
  48. package/dist/types/context/OwpAppProvider.d.ts +4 -3
  49. package/dist/types/default-settings/OwpDefaultSettings.d.ts +25 -171
  50. package/dist/types/hooks/index.d.ts +1 -0
  51. package/dist/types/hooks/useAccessTokenGuard.d.ts +12 -0
  52. package/dist/types/hooks/useStorage.d.ts +0 -13
  53. package/dist/types/index.d.ts +1 -5
  54. package/dist/types/store/index.d.ts +1 -0
  55. package/dist/types/{components/OwpSettings → store}/owpSettingsSlice.d.ts +1 -456
  56. package/dist/types/{components/OwpSettings/OwpSettings.d.ts → types/OwpSettingsTypes.d.ts} +0 -12
  57. package/dist/types/utils/common/OwpUtils.d.ts +1 -1
  58. package/dist/usePageLockLoading-BUI_3PlR.js +39 -0
  59. package/dist/usePageLockLoading-BUI_3PlR.js.map +1 -0
  60. package/dist/useShortcuts-CCf98L8m.js +241 -0
  61. package/dist/useShortcuts-CCf98L8m.js.map +1 -0
  62. package/dist/useStorage-CuUmH4fD.js +50 -0
  63. package/dist/useStorage-CuUmH4fD.js.map +1 -0
  64. package/dist/useTreeGridExcelExport-N2nOKmkz.js +138 -0
  65. package/dist/useTreeGridExcelExport-N2nOKmkz.js.map +1 -0
  66. package/dist/utils.js +294 -293
  67. package/dist/utils.js.map +1 -1
  68. package/package.json +2 -11
  69. package/dist/Close-DnXhM4Ms.js.map +0 -1
  70. package/dist/OwpStoreProvider-B7W25pkq.js +0 -34
  71. package/dist/OwpStoreProvider-B7W25pkq.js.map +0 -1
  72. package/dist/OwpUtils-9lHSCdan.js.map +0 -1
  73. package/dist/index-B8tZAW8i.js.map +0 -1
  74. package/dist/language-CwsGUe4C.js +0 -5
  75. package/dist/language-CwsGUe4C.js.map +0 -1
  76. package/dist/lazyLoadedSlices-BAbcXcEU.js.map +0 -1
  77. package/dist/storageKeys-DRzte9LZ.js +0 -15
  78. package/dist/storageKeys-DRzte9LZ.js.map +0 -1
  79. package/dist/treeGrid-CjB04cBq.js +0 -35
  80. package/dist/treeGrid-CjB04cBq.js.map +0 -1
  81. package/dist/types/components/OwpSettings/OwpLayoutConfig.d.ts +0 -16
  82. package/dist/types/components/OwpSettings/OwpLayoutConfigs.d.ts +0 -14
  83. package/dist/types/components/OwpSettings/index.d.ts +0 -1
  84. package/dist/types/components/OwpSettings/palette-generator/PalettePreview.d.ts +0 -14
  85. package/dist/types/components/OwpSettings/palette-generator/PaletteSelector.d.ts +0 -15
  86. package/dist/types/components/OwpSettings/palette-generator/SectionPreview.d.ts +0 -12
  87. package/dist/types/store/apiService.d.ts +0 -6
  88. package/dist/useOwpTranslation-BelpX-fd.js +0 -174
  89. package/dist/useOwpTranslation-BelpX-fd.js.map +0 -1
  90. package/dist/useStorage-BA0D8KA7.js +0 -67
  91. package/dist/useStorage-BA0D8KA7.js.map +0 -1
  92. package/dist/useTreeGridExcelExport-QNcWzx5v.js +0 -195
  93. package/dist/useTreeGridExcelExport-QNcWzx5v.js.map +0 -1
  94. /package/dist/types/{components/OwpSettings → types}/ThemeFormConfigTypes.d.ts +0 -0
@@ -1,6 +1,5 @@
1
- import { OwpSettingsConfigType, OwpThemesType } from '@/components/OwpSettings/OwpSettings';
1
+ import type { OwpThemesType } from '@/types/OwpSettingsTypes';
2
2
  import { createSelector, PayloadAction } from '@reduxjs/toolkit';
3
- import { PartialDeep } from 'type-fest';
4
3
  /**
5
4
  * The lightPaletteText object defines the text color palette for the light theme.
6
5
  */
@@ -927,460 +926,6 @@ export declare const changeOwpTheme: import("@reduxjs/toolkit").AsyncThunk<Paylo
927
926
  } | ({
928
927
  rejectedWithValue: false;
929
928
  } & {})), import("@reduxjs/toolkit").SerializedError>, OwpThemesType, import("@reduxjs/toolkit").AsyncThunkConfig>;
930
- /**
931
- * Generates the settings object by merging the default settings with the new settings.
932
- */
933
- export declare function generateSettings(_defaultSettings: OwpSettingsConfigType, _newSettings: PartialDeep<OwpSettingsConfigType>): OwpSettingsConfigType & {
934
- layout: {
935
- config: import("@/components/layouts/themeLayoutConfigs").themeLayoutDefaultsProps;
936
- };
937
- } & {
938
- layout?: {
939
- style?: string;
940
- config?: {
941
- mode?: string;
942
- containerWidth?: string;
943
- navbar?: {
944
- display?: boolean;
945
- style?: string;
946
- folded?: boolean;
947
- position?: string;
948
- open?: boolean;
949
- };
950
- toolbar?: {
951
- display?: boolean;
952
- style?: string;
953
- };
954
- footer?: {
955
- display?: boolean;
956
- style?: string;
957
- };
958
- leftSidePanel?: {
959
- display?: boolean;
960
- };
961
- rightSidePanel?: {
962
- display?: boolean;
963
- };
964
- } | {
965
- mode?: string;
966
- containerWidth?: number;
967
- navbar?: {
968
- display?: boolean;
969
- style?: string;
970
- folded?: boolean;
971
- };
972
- toolbar?: {
973
- display?: boolean;
974
- style?: string;
975
- position?: string;
976
- };
977
- footer?: {
978
- display?: boolean;
979
- style?: string;
980
- };
981
- leftSidePanel?: {
982
- display?: boolean;
983
- };
984
- rightSidePanel?: {
985
- display?: boolean;
986
- };
987
- } | {
988
- mode?: string;
989
- containerWidth?: number;
990
- scroll?: string;
991
- navbar?: {
992
- display?: boolean;
993
- style?: string;
994
- folded?: boolean;
995
- };
996
- toolbar?: {
997
- display?: boolean;
998
- style?: string;
999
- position?: string;
1000
- };
1001
- footer?: {
1002
- display?: boolean;
1003
- style?: string;
1004
- };
1005
- leftSidePanel?: {
1006
- display?: boolean;
1007
- };
1008
- rightSidePanel?: {
1009
- display?: boolean;
1010
- };
1011
- };
1012
- };
1013
- customScrollbars?: boolean;
1014
- direction?: "rtl" | "ltr";
1015
- theme?: {
1016
- main?: {
1017
- palette?: {
1018
- common?: {
1019
- black?: string;
1020
- white?: string;
1021
- };
1022
- mode?: import("@mui/material").PaletteMode;
1023
- contrastThreshold?: number;
1024
- tonalOffset?: number | {
1025
- light?: number;
1026
- dark?: number;
1027
- };
1028
- primary?: {
1029
- light?: string;
1030
- main?: string;
1031
- dark?: string;
1032
- contrastText?: string;
1033
- };
1034
- secondary?: {
1035
- light?: string;
1036
- main?: string;
1037
- dark?: string;
1038
- contrastText?: string;
1039
- };
1040
- error?: {
1041
- light?: string;
1042
- main?: string;
1043
- dark?: string;
1044
- contrastText?: string;
1045
- };
1046
- warning?: {
1047
- light?: string;
1048
- main?: string;
1049
- dark?: string;
1050
- contrastText?: string;
1051
- };
1052
- info?: {
1053
- light?: string;
1054
- main?: string;
1055
- dark?: string;
1056
- contrastText?: string;
1057
- };
1058
- success?: {
1059
- light?: string;
1060
- main?: string;
1061
- dark?: string;
1062
- contrastText?: string;
1063
- };
1064
- grey?: {
1065
- 50?: string;
1066
- 100?: string;
1067
- 200?: string;
1068
- 300?: string;
1069
- 400?: string;
1070
- 500?: string;
1071
- 600?: string;
1072
- 700?: string;
1073
- 800?: string;
1074
- 900?: string;
1075
- A100?: string;
1076
- A200?: string;
1077
- A400?: string;
1078
- A700?: string;
1079
- };
1080
- text?: {
1081
- primary?: string;
1082
- secondary?: string;
1083
- disabled?: string;
1084
- };
1085
- divider?: import("@mui/material/styles/createPalette").TypeDivider;
1086
- action?: {
1087
- active?: string;
1088
- hover?: string;
1089
- hoverOpacity?: number;
1090
- selected?: string;
1091
- selectedOpacity?: number;
1092
- disabled?: string;
1093
- disabledOpacity?: number;
1094
- disabledBackground?: string;
1095
- focus?: string;
1096
- focusOpacity?: number;
1097
- activatedOpacity?: number;
1098
- };
1099
- background?: {
1100
- default?: string;
1101
- paper?: string;
1102
- };
1103
- getContrastText?: (background: string) => string;
1104
- augmentColor?: (options: import("@mui/material/styles/createPalette").PaletteAugmentColorOptions) => import("@mui/material").PaletteColor;
1105
- };
1106
- };
1107
- navbar?: {
1108
- palette?: {
1109
- common?: {
1110
- black?: string;
1111
- white?: string;
1112
- };
1113
- mode?: import("@mui/material").PaletteMode;
1114
- contrastThreshold?: number;
1115
- tonalOffset?: number | {
1116
- light?: number;
1117
- dark?: number;
1118
- };
1119
- primary?: {
1120
- light?: string;
1121
- main?: string;
1122
- dark?: string;
1123
- contrastText?: string;
1124
- };
1125
- secondary?: {
1126
- light?: string;
1127
- main?: string;
1128
- dark?: string;
1129
- contrastText?: string;
1130
- };
1131
- error?: {
1132
- light?: string;
1133
- main?: string;
1134
- dark?: string;
1135
- contrastText?: string;
1136
- };
1137
- warning?: {
1138
- light?: string;
1139
- main?: string;
1140
- dark?: string;
1141
- contrastText?: string;
1142
- };
1143
- info?: {
1144
- light?: string;
1145
- main?: string;
1146
- dark?: string;
1147
- contrastText?: string;
1148
- };
1149
- success?: {
1150
- light?: string;
1151
- main?: string;
1152
- dark?: string;
1153
- contrastText?: string;
1154
- };
1155
- grey?: {
1156
- 50?: string;
1157
- 100?: string;
1158
- 200?: string;
1159
- 300?: string;
1160
- 400?: string;
1161
- 500?: string;
1162
- 600?: string;
1163
- 700?: string;
1164
- 800?: string;
1165
- 900?: string;
1166
- A100?: string;
1167
- A200?: string;
1168
- A400?: string;
1169
- A700?: string;
1170
- };
1171
- text?: {
1172
- primary?: string;
1173
- secondary?: string;
1174
- disabled?: string;
1175
- };
1176
- divider?: import("@mui/material/styles/createPalette").TypeDivider;
1177
- action?: {
1178
- active?: string;
1179
- hover?: string;
1180
- hoverOpacity?: number;
1181
- selected?: string;
1182
- selectedOpacity?: number;
1183
- disabled?: string;
1184
- disabledOpacity?: number;
1185
- disabledBackground?: string;
1186
- focus?: string;
1187
- focusOpacity?: number;
1188
- activatedOpacity?: number;
1189
- };
1190
- background?: {
1191
- default?: string;
1192
- paper?: string;
1193
- };
1194
- getContrastText?: (background: string) => string;
1195
- augmentColor?: (options: import("@mui/material/styles/createPalette").PaletteAugmentColorOptions) => import("@mui/material").PaletteColor;
1196
- };
1197
- };
1198
- toolbar?: {
1199
- palette?: {
1200
- common?: {
1201
- black?: string;
1202
- white?: string;
1203
- };
1204
- mode?: import("@mui/material").PaletteMode;
1205
- contrastThreshold?: number;
1206
- tonalOffset?: number | {
1207
- light?: number;
1208
- dark?: number;
1209
- };
1210
- primary?: {
1211
- light?: string;
1212
- main?: string;
1213
- dark?: string;
1214
- contrastText?: string;
1215
- };
1216
- secondary?: {
1217
- light?: string;
1218
- main?: string;
1219
- dark?: string;
1220
- contrastText?: string;
1221
- };
1222
- error?: {
1223
- light?: string;
1224
- main?: string;
1225
- dark?: string;
1226
- contrastText?: string;
1227
- };
1228
- warning?: {
1229
- light?: string;
1230
- main?: string;
1231
- dark?: string;
1232
- contrastText?: string;
1233
- };
1234
- info?: {
1235
- light?: string;
1236
- main?: string;
1237
- dark?: string;
1238
- contrastText?: string;
1239
- };
1240
- success?: {
1241
- light?: string;
1242
- main?: string;
1243
- dark?: string;
1244
- contrastText?: string;
1245
- };
1246
- grey?: {
1247
- 50?: string;
1248
- 100?: string;
1249
- 200?: string;
1250
- 300?: string;
1251
- 400?: string;
1252
- 500?: string;
1253
- 600?: string;
1254
- 700?: string;
1255
- 800?: string;
1256
- 900?: string;
1257
- A100?: string;
1258
- A200?: string;
1259
- A400?: string;
1260
- A700?: string;
1261
- };
1262
- text?: {
1263
- primary?: string;
1264
- secondary?: string;
1265
- disabled?: string;
1266
- };
1267
- divider?: import("@mui/material/styles/createPalette").TypeDivider;
1268
- action?: {
1269
- active?: string;
1270
- hover?: string;
1271
- hoverOpacity?: number;
1272
- selected?: string;
1273
- selectedOpacity?: number;
1274
- disabled?: string;
1275
- disabledOpacity?: number;
1276
- disabledBackground?: string;
1277
- focus?: string;
1278
- focusOpacity?: number;
1279
- activatedOpacity?: number;
1280
- };
1281
- background?: {
1282
- default?: string;
1283
- paper?: string;
1284
- };
1285
- getContrastText?: (background: string) => string;
1286
- augmentColor?: (options: import("@mui/material/styles/createPalette").PaletteAugmentColorOptions) => import("@mui/material").PaletteColor;
1287
- };
1288
- };
1289
- footer?: {
1290
- palette?: {
1291
- common?: {
1292
- black?: string;
1293
- white?: string;
1294
- };
1295
- mode?: import("@mui/material").PaletteMode;
1296
- contrastThreshold?: number;
1297
- tonalOffset?: number | {
1298
- light?: number;
1299
- dark?: number;
1300
- };
1301
- primary?: {
1302
- light?: string;
1303
- main?: string;
1304
- dark?: string;
1305
- contrastText?: string;
1306
- };
1307
- secondary?: {
1308
- light?: string;
1309
- main?: string;
1310
- dark?: string;
1311
- contrastText?: string;
1312
- };
1313
- error?: {
1314
- light?: string;
1315
- main?: string;
1316
- dark?: string;
1317
- contrastText?: string;
1318
- };
1319
- warning?: {
1320
- light?: string;
1321
- main?: string;
1322
- dark?: string;
1323
- contrastText?: string;
1324
- };
1325
- info?: {
1326
- light?: string;
1327
- main?: string;
1328
- dark?: string;
1329
- contrastText?: string;
1330
- };
1331
- success?: {
1332
- light?: string;
1333
- main?: string;
1334
- dark?: string;
1335
- contrastText?: string;
1336
- };
1337
- grey?: {
1338
- 50?: string;
1339
- 100?: string;
1340
- 200?: string;
1341
- 300?: string;
1342
- 400?: string;
1343
- 500?: string;
1344
- 600?: string;
1345
- 700?: string;
1346
- 800?: string;
1347
- 900?: string;
1348
- A100?: string;
1349
- A200?: string;
1350
- A400?: string;
1351
- A700?: string;
1352
- };
1353
- text?: {
1354
- primary?: string;
1355
- secondary?: string;
1356
- disabled?: string;
1357
- };
1358
- divider?: import("@mui/material/styles/createPalette").TypeDivider;
1359
- action?: {
1360
- active?: string;
1361
- hover?: string;
1362
- hoverOpacity?: number;
1363
- selected?: string;
1364
- selectedOpacity?: number;
1365
- disabled?: string;
1366
- disabledOpacity?: number;
1367
- disabledBackground?: string;
1368
- focus?: string;
1369
- focusOpacity?: number;
1370
- activatedOpacity?: number;
1371
- };
1372
- background?: {
1373
- default?: string;
1374
- paper?: string;
1375
- };
1376
- getContrastText?: (background: string) => string;
1377
- augmentColor?: (options: import("@mui/material/styles/createPalette").PaletteAugmentColorOptions) => import("@mui/material").PaletteColor;
1378
- };
1379
- };
1380
- };
1381
- defaultAuth?: string[];
1382
- loginRedirectUrl?: string;
1383
- };
1384
929
  /**
1385
930
  * Sets the default settings for the application.
1386
931
  */
@@ -23,15 +23,3 @@ export type OwpSettingsConfigType = {
23
23
  defaultAuth?: string[];
24
24
  loginRedirectUrl: string;
25
25
  };
26
- /**
27
- * The OwpSettings component is responsible for rendering the settings form for the Owp React application.
28
- * It uses the useForm hook from the react-hook-form library to handle form state and validation.
29
- * It also uses various MUI components to render the form fields and sections.
30
- * The component is memoized to prevent unnecessary re-renders.
31
- */
32
- declare function OwpSettings(): import("react/jsx-runtime").JSX.Element;
33
- /**
34
- * OwpSettingsMemo 메모이징 컴포넌트
35
- */
36
- declare const OwpSettingsMemo: import("react").MemoExoticComponent<typeof OwpSettings>;
37
- export { OwpSettingsMemo as OwpSettings };
@@ -1,5 +1,5 @@
1
1
  import { OwpEventEmitter } from '@/components/OwpEventEmitter';
2
- import { OwpSettingsConfigType } from '@/components/OwpSettings/OwpSettings';
2
+ import type { OwpSettingsConfigType } from '@/types/OwpSettingsTypes';
3
3
  import { DeepPartial } from 'react-hook-form';
4
4
  import { RouteObject } from 'react-router-dom';
5
5
  import { PartialDeep } from 'type-fest';
@@ -0,0 +1,39 @@
1
+ var L = Object.defineProperty;
2
+ var e = (t, o) => L(t, "name", { value: o, configurable: !0 });
3
+ import { S } from "./localStorageKeys-Che0CNci.js";
4
+ import { u as g } from "./useShortcuts-CCf98L8m.js";
5
+ import { useRef as T, useEffect as G } from "react";
6
+ import { useLocation as _, useNavigate as R } from "react-router-dom";
7
+ import { S as a } from "./storageKeys-C6xHFiTo.js";
8
+ import { useAtomValue as i, useSetAtom as d } from "jotai";
9
+ import { atomWithStorage as m } from "jotai/utils";
10
+ const k = "/auth/login", C = "Message.로그인이 필요합니다.", v = /* @__PURE__ */ e(({
11
+ loginPath: t = k,
12
+ isEnabled: o,
13
+ snackbarMessageKey: r = C
14
+ } = {}) => {
15
+ const { env: s } = g(), l = _(), u = R(), p = typeof window > "u" ? null : window.localStorage.getItem(S), E = l.pathname.startsWith(t), n = (o ?? (s == null ? void 0 : s.isAccessTokenGuardEnabled) ?? !0) && !p && !E, c = T(!1);
16
+ return G(() => {
17
+ if (!n) {
18
+ c.current = !1;
19
+ return;
20
+ }
21
+ c.current || (c.current = !0, u(t, {
22
+ replace: !0,
23
+ state: r ? {
24
+ snackbarMessageKey: r
25
+ } : void 0
26
+ }));
27
+ }, [t, u, n, r]), n;
28
+ }, "useAccessTokenGuard"), f = m(a.currentUserId, ""), x = /* @__PURE__ */ e(() => i(f), "useGetCurrentUserId"), D = /* @__PURE__ */ e(() => d(f), "useSetCurrentUserId"), A = m(
29
+ a.lockLoadingProps,
30
+ { loading: !1 }
31
+ ), F = /* @__PURE__ */ e(() => i(A), "useGetPageLockLoading"), H = /* @__PURE__ */ e(() => ({ setLoading: d(A) }), "usePageLockLoading");
32
+ export {
33
+ v as a,
34
+ x as b,
35
+ D as c,
36
+ H as d,
37
+ F as u
38
+ };
39
+ //# sourceMappingURL=usePageLockLoading-BUI_3PlR.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"usePageLockLoading-BUI_3PlR.js","sources":["../src/hooks/useAccessTokenGuard.ts","../src/hooks/useCurrentUserId.ts","../src/hooks/usePageLockLoading.ts"],"sourcesContent":["import { STORAGE_ACCESS_TOKEN_KEY } from '@/constants/localStorageKeys';\nimport { useOwpAppContext } from '@/context/OwpAppProvider';\nimport { useEffect, useRef } from 'react';\nimport { useLocation, useNavigate } from 'react-router-dom';\n\nexport interface UseAccessTokenGuardOptions {\n loginPath?: string;\n isEnabled?: boolean;\n snackbarMessageKey?: string;\n}\n\nconst DEFAULT_LOGIN_PATH = '/auth/login';\nconst DEFAULT_SNACKBAR_MESSAGE_KEY = 'Message.로그인이 필요합니다.';\n\n/**\n * 액세스 토큰 기반 로그인 가드\n * @param loginPath 로그인 라우트 경로\n * @param isEnabled 가드 활성화 여부\n * @param snackbarMessageKey 로그인 필요 안내 메시지 키\n */\nexport const useAccessTokenGuard = ({\n loginPath = DEFAULT_LOGIN_PATH,\n isEnabled,\n snackbarMessageKey = DEFAULT_SNACKBAR_MESSAGE_KEY,\n}: UseAccessTokenGuardOptions = {}) => {\n const { env } = useOwpAppContext();\n const location = useLocation();\n const navigate = useNavigate();\n const accessToken =\n typeof window === 'undefined' ? null : window.localStorage.getItem(STORAGE_ACCESS_TOKEN_KEY);\n const isLoginRoute = location.pathname.startsWith(loginPath);\n const isAccessTokenGuardEnabled = isEnabled ?? env?.isAccessTokenGuardEnabled ?? true;\n const shouldRedirectToLogin = isAccessTokenGuardEnabled && !accessToken && !isLoginRoute;\n const hasHandledRedirectRef = useRef(false);\n\n useEffect(() => {\n if (!shouldRedirectToLogin) {\n hasHandledRedirectRef.current = false;\n return;\n }\n\n if (hasHandledRedirectRef.current) {\n return;\n }\n\n hasHandledRedirectRef.current = true;\n\n navigate(loginPath, {\n replace: true,\n state: snackbarMessageKey\n ? {\n snackbarMessageKey,\n }\n : undefined,\n });\n }, [loginPath, navigate, shouldRedirectToLogin, snackbarMessageKey]);\n\n return shouldRedirectToLogin;\n};\n","import { STORAGE_KEYS } from '@/constants/storageKeys';\nimport { useAtomValue, useSetAtom } from 'jotai';\nimport { atomWithStorage } from 'jotai/utils';\n\nconst currentUserIdAtom = atomWithStorage<string | ''>(STORAGE_KEYS.currentUserId, '');\n\n/**\n * 현재 사용자 ID 조회 훅\n */\nexport const useGetCurrentUserId = () => {\n return useAtomValue(currentUserIdAtom);\n};\n\n/**\n * 현재 사용자 ID 설정 훅\n */\nexport const useSetCurrentUserId = () => {\n return useSetAtom(currentUserIdAtom);\n};\n","import type { OwpPageLockLoadingProps } from '@/components/OwpPageLockLoading';\nimport { STORAGE_KEYS } from '@/constants/storageKeys';\nimport { useAtomValue, useSetAtom } from 'jotai';\nimport { atomWithStorage } from 'jotai/utils';\n\nconst currentLockLoadingAtom = atomWithStorage<OwpPageLockLoadingProps | undefined>(\n STORAGE_KEYS.lockLoadingProps,\n { loading: false },\n);\n\n/**\n * 페이지 잠금 로딩 상태 조회\n */\nexport const useGetPageLockLoading = () => {\n return useAtomValue(currentLockLoadingAtom);\n};\n\n/**\n * 페이지 잠금 로딩 상태 설정\n */\nexport const usePageLockLoading = () => {\n return { setLoading: useSetAtom(currentLockLoadingAtom) };\n};\n"],"names":["DEFAULT_LOGIN_PATH","DEFAULT_SNACKBAR_MESSAGE_KEY","useAccessTokenGuard","__name","loginPath","isEnabled","snackbarMessageKey","env","useOwpAppContext","location","useLocation","navigate","useNavigate","accessToken","STORAGE_ACCESS_TOKEN_KEY","isLoginRoute","shouldRedirectToLogin","hasHandledRedirectRef","useRef","useEffect","currentUserIdAtom","atomWithStorage","STORAGE_KEYS","useGetCurrentUserId","useAtomValue","useSetCurrentUserId","useSetAtom","currentLockLoadingAtom","useGetPageLockLoading","usePageLockLoading"],"mappings":";;;;;;;;;AAWA,MAAMA,IAAqB,eACrBC,IAA+B,uBAQxBC,IAAsB,gBAAAC,EAAA,CAAC;AAAA,EAClC,WAAAC,IAAYJ;AAAA,EACZ,WAAAK;AAAA,EACA,oBAAAC,IAAqBL;AACvB,IAAgC,OAAO;AACrC,QAAM,EAAE,KAAAM,EAAA,IAAQC,EAAA,GACVC,IAAWC,EAAA,GACXC,IAAWC,EAAA,GACXC,IACJ,OAAO,SAAW,MAAc,OAAO,OAAO,aAAa,QAAQC,CAAwB,GACvFC,IAAeN,EAAS,SAAS,WAAWL,CAAS,GAErDY,KAD4BX,MAAaE,KAAA,gBAAAA,EAAK,8BAA6B,OACtB,CAACM,KAAe,CAACE,GACtEE,IAAwBC,EAAO,EAAK;AAE1C,SAAAC,EAAU,MAAM;AACd,QAAI,CAACH,GAAuB;AAC1B,MAAAC,EAAsB,UAAU;AAChC;AAAA,IACF;AAEA,IAAIA,EAAsB,YAI1BA,EAAsB,UAAU,IAEhCN,EAASP,GAAW;AAAA,MAClB,SAAS;AAAA,MACT,OAAOE,IACH;AAAA,QACE,oBAAAA;AAAA,MAAA,IAEF;AAAA,IAAA,CACL;AAAA,EACH,GAAG,CAACF,GAAWO,GAAUK,GAAuBV,CAAkB,CAAC,GAE5DU;AACT,GAtCmC,wBChB7BI,IAAoBC,EAA6BC,EAAa,eAAe,EAAE,GAKxEC,IAAsB,gBAAApB,EAAA,MAC1BqB,EAAaJ,CAAiB,GADJ,wBAOtBK,IAAsB,gBAAAtB,EAAA,MAC1BuB,EAAWN,CAAiB,GADF,wBCX7BO,IAAyBN;AAAA,EAC7BC,EAAa;AAAA,EACb,EAAE,SAAS,GAAA;AACb,GAKaM,IAAwB,gBAAAzB,EAAA,MAC5BqB,EAAaG,CAAsB,GADP,0BAOxBE,IAAqB,gBAAA1B,EAAA,OACzB,EAAE,YAAYuB,EAAWC,CAAsB,EAAA,IADtB;"}