@bstage-sdk/bridge 0.14.2 → 0.15.1

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/dist/index.cjs CHANGED
@@ -20,6 +20,7 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
20
20
  // src/index.ts
21
21
  var src_exports = {};
22
22
  __export(src_exports, {
23
+ ACCOUNT_SESSION_CAPABILITY: () => ACCOUNT_SESSION_CAPABILITY,
23
24
  BRIDGE_ERROR_CODES: () => BRIDGE_ERROR_CODES,
24
25
  BRIDGE_NAMESPACE: () => BRIDGE_NAMESPACE,
25
26
  BRIDGE_SURFACES: () => BRIDGE_SURFACES,
@@ -29,10 +30,12 @@ __export(src_exports, {
29
30
  HOST_EVENT_TYPES: () => HOST_EVENT_TYPES,
30
31
  IFRAME_ATTRIBUTES: () => IFRAME_ATTRIBUTES,
31
32
  INIT_RESPONSE: () => INIT_RESPONSE,
33
+ KNOWN_CAPABILITIES: () => KNOWN_CAPABILITIES,
32
34
  MAX_ELEMENT_NAME_LENGTH: () => MAX_ELEMENT_NAME_LENGTH,
33
35
  MAX_ENVELOPE_ID_LENGTH: () => MAX_ENVELOPE_ID_LENGTH,
34
36
  MAX_ENVELOPE_TYPE_LENGTH: () => MAX_ENVELOPE_TYPE_LENGTH,
35
37
  MAX_MEDIA_ORIGINS: () => MAX_MEDIA_ORIGINS,
38
+ OTP_OPS: () => OTP_OPS,
36
39
  READY_EVENT: () => READY_EVENT,
37
40
  REPORTS_PER_SESSION: () => REPORTS_PER_SESSION,
38
41
  REPORT_COUNT_MAX: () => REPORT_COUNT_MAX,
@@ -42,6 +45,7 @@ __export(src_exports, {
42
45
  REPORT_MESSAGE_MAX_LENGTH: () => REPORT_MESSAGE_MAX_LENGTH,
43
46
  REQUEST_TIMEOUT_MS: () => REQUEST_TIMEOUT_MS,
44
47
  REQUEST_TYPES: () => REQUEST_TYPES,
48
+ SESSION_OPS: () => SESSION_OPS,
45
49
  TEMPLATE_REPORT_KINDS: () => TEMPLATE_REPORT_KINDS,
46
50
  buildFrameCsp: () => buildFrameCsp,
47
51
  createEnvelope: () => createEnvelope,
@@ -90,7 +94,9 @@ var BRIDGE_ERROR_CODES = [
90
94
  "BAD_REQUEST",
91
95
  "TIMEOUT",
92
96
  "NETWORK_ERROR",
93
- "UNSUPPORTED"
97
+ "UNSUPPORTED",
98
+ // 권한(capability) 없는 배치의 계정 요청, 또는 결속 조건을 벗어난 세션 요청.
99
+ "NOT_ALLOWED"
94
100
  ];
95
101
  var BridgeError = class extends Error {
96
102
  constructor(code, message) {
@@ -118,7 +124,9 @@ var REQUEST_TYPES = [
118
124
  "track",
119
125
  "storage",
120
126
  "log",
121
- "report"
127
+ "report",
128
+ "session",
129
+ "otp"
122
130
  ];
123
131
  var HOST_EVENT_TYPES = ["slot.context", "locale", "member", "theme", "visibility"];
124
132
  var READY_EVENT = "ready";
@@ -128,6 +136,15 @@ var BRIDGE_SURFACES = ["page", "slot"];
128
136
  function isBridgeSurface(value) {
129
137
  return BRIDGE_SURFACES.includes(value);
130
138
  }
139
+ var ACCOUNT_SESSION_CAPABILITY = "account-session";
140
+ var KNOWN_CAPABILITIES = [ACCOUNT_SESSION_CAPABILITY];
141
+ var SESSION_OPS = ["signup", "signupSocial", "loginAfterSignup", "phoneReverify"];
142
+ var OTP_OPS = [
143
+ "sendSignup",
144
+ "sendPhoneChange",
145
+ "verifySignup",
146
+ "verifyPhoneChange"
147
+ ];
131
148
  var TEMPLATE_REPORT_KINDS = ["error", "rejection", "load"];
132
149
  var REPORT_MESSAGE_MAX_LENGTH = 300;
133
150
  var REPORT_MAX_FRAMES = 10;
@@ -867,7 +884,550 @@ var LOCAL_HOST_NAMES = Object.freeze([
867
884
  "localdomain"
868
885
  ]);
869
886
 
887
+ // ../design/dist/user/index.js
888
+ var modeColors = {
889
+ "bg/base": {
890
+ "dark": "#151515",
891
+ "light": "#ffffff"
892
+ },
893
+ "bg/blue-grey": {
894
+ "dark": "#1f2023",
895
+ "light": "#eff1f7"
896
+ },
897
+ "bg/elevated": {
898
+ "dark": "#232323",
899
+ "light": "#ffffff"
900
+ },
901
+ "bg/grouped-strong": {
902
+ "dark": "#000000",
903
+ "light": "#f7f7f7"
904
+ },
905
+ "bg/grouped-weak": {
906
+ "dark": "#111111",
907
+ "light": "#f7f7f7"
908
+ },
909
+ "bg/grouped-weak-a": {
910
+ "dark": "#ffffff0f",
911
+ "light": "#0000000f"
912
+ },
913
+ "bg/highlight": {
914
+ "dark": "#2f2f2f",
915
+ "light": "#e6e6e6"
916
+ },
917
+ "bg/invert-weak-a": {
918
+ "dark": "#00000026",
919
+ "light": "#ffffff26"
920
+ },
921
+ "border/blue": {
922
+ "dark": "#0090ff",
923
+ "light": "#148aff"
924
+ },
925
+ "border/blue-weak-a": {
926
+ "dark": "#0090ff4d",
927
+ "light": "#148aff4d"
928
+ },
929
+ "border/default-a": {
930
+ "dark": "#ffffff1a",
931
+ "light": "#0000001a"
932
+ },
933
+ "border/divider-weaker": {
934
+ "dark": "#0d0d0d",
935
+ "light": "#f7f7f7"
936
+ },
937
+ "border/green": {
938
+ "dark": "#0be06f",
939
+ "light": "#00b84d"
940
+ },
941
+ "border/green-weak-a": {
942
+ "dark": "#0be06f4d",
943
+ "light": "#00b84d4d"
944
+ },
945
+ "border/grey": {
946
+ "dark": "#b3b3b3",
947
+ "light": "#7a7a7a"
948
+ },
949
+ "border/grey-weak-a": {
950
+ "dark": "#b3b3b34d",
951
+ "light": "#7a7a7a4d"
952
+ },
953
+ "border/invert": {
954
+ "dark": "#0d0d0d",
955
+ "light": "#ffffff"
956
+ },
957
+ "border/red": {
958
+ "dark": "#ff4747",
959
+ "light": "#ff4a40"
960
+ },
961
+ "border/red-weak-a": {
962
+ "dark": "#ff47474d",
963
+ "light": "#ff4a404d"
964
+ },
965
+ "border/strong-a": {
966
+ "dark": "#ffffff33",
967
+ "light": "#00000033"
968
+ },
969
+ "border/stronger": {
970
+ "dark": "#eeeeee",
971
+ "light": "#454545"
972
+ },
973
+ "border/weak-a": {
974
+ "dark": "#ffffff0a",
975
+ "light": "#0000000f"
976
+ },
977
+ "border/yellow": {
978
+ "dark": "#f5b625",
979
+ "light": "#f29900"
980
+ },
981
+ "border/yellow-weak-a": {
982
+ "dark": "#f5b6254d",
983
+ "light": "#f299004d"
984
+ },
985
+ "icon/blue": {
986
+ "dark": "#0090ff",
987
+ "light": "#148aff"
988
+ },
989
+ "icon/green": {
990
+ "dark": "#0be06f",
991
+ "light": "#00b84d"
992
+ },
993
+ "icon/grey": {
994
+ "dark": "#b3b3b3",
995
+ "light": "#7a7a7a"
996
+ },
997
+ "icon/invert": {
998
+ "dark": "#0d0d0d",
999
+ "light": "#ffffff"
1000
+ },
1001
+ "icon/primary": {
1002
+ "dark": "#ffffff",
1003
+ "light": "#000000"
1004
+ },
1005
+ "icon/quaternary-a": {
1006
+ "dark": "#ffffff4d",
1007
+ "light": "#0000004d"
1008
+ },
1009
+ "icon/red": {
1010
+ "dark": "#ff4747",
1011
+ "light": "#ff4a40"
1012
+ },
1013
+ "icon/secondary-a": {
1014
+ "dark": "#ffffffba",
1015
+ "light": "#000000ba"
1016
+ },
1017
+ "icon/tertiary-a": {
1018
+ "dark": "#ffffff80",
1019
+ "light": "#00000080"
1020
+ },
1021
+ "icon/yellow": {
1022
+ "dark": "#f5b625",
1023
+ "light": "#f29900"
1024
+ },
1025
+ "overlay/hover-a": {
1026
+ "dark": "#ffffff14",
1027
+ "light": "#0000001a"
1028
+ },
1029
+ "overlay/hover-grey-a": {
1030
+ "dark": "#4545451a",
1031
+ "light": "#4545451a"
1032
+ },
1033
+ "overlay/press-a": {
1034
+ "dark": "#ffffff33",
1035
+ "light": "#00000026"
1036
+ },
1037
+ "overlay/press-grey-a": {
1038
+ "dark": "#45454526",
1039
+ "light": "#45454526"
1040
+ },
1041
+ "service/live": {
1042
+ "dark": "#e51a42",
1043
+ "light": "#e2012d"
1044
+ },
1045
+ "service/live-weak-a": {
1046
+ "dark": "#e51a4226",
1047
+ "light": "#e2012d4d"
1048
+ },
1049
+ "service/membership": {
1050
+ "dark": "#ffbf00",
1051
+ "light": "#ffb010"
1052
+ },
1053
+ "service/membership-weak-a": {
1054
+ "dark": "#ffbf001f",
1055
+ "light": "#eb91001f"
1056
+ },
1057
+ "service/noti": {
1058
+ "dark": "#0c198b",
1059
+ "light": "#020f81"
1060
+ },
1061
+ "service/pop-bg": {
1062
+ "dark": "linear-gradient(135deg, #3b3a2d 13.08%, #232732 87.56%)",
1063
+ "light": "linear-gradient(135deg, #faf7de 13.08%, #e7edfd 87.56%)"
1064
+ },
1065
+ "surface/card": {
1066
+ "dark": "#232323",
1067
+ "light": "#ffffff"
1068
+ },
1069
+ "surface/display-bar-bottom": {
1070
+ "dark": "#151515",
1071
+ "light": "#fdfdfd"
1072
+ },
1073
+ "surface/display-bar-top": {
1074
+ "dark": "#151515",
1075
+ "light": "#ffffff"
1076
+ },
1077
+ "surface/display-lock": {
1078
+ "dark": "#2f2f2f",
1079
+ "light": "#bfbfbf"
1080
+ },
1081
+ "surface/form-blue": {
1082
+ "dark": "#0090ff",
1083
+ "light": "#148aff"
1084
+ },
1085
+ "surface/form-blue-weak-a": {
1086
+ "dark": "#0f97ff1f",
1087
+ "light": "#007aff26"
1088
+ },
1089
+ "surface/form-gradient-h": {
1090
+ "dark": "linear-gradient(90deg, #151515 0%, #15151500 100%)",
1091
+ "light": "linear-gradient(90deg, #ffffff 0%, #ffffff00 100%)"
1092
+ },
1093
+ "surface/form-green": {
1094
+ "dark": "#00cc5f",
1095
+ "light": "#00bf59"
1096
+ },
1097
+ "surface/form-green-weak-a": {
1098
+ "dark": "#0be06f14",
1099
+ "light": "#00b84d26"
1100
+ },
1101
+ "surface/form-grey": {
1102
+ "dark": "#7a7a7a",
1103
+ "light": "#999999"
1104
+ },
1105
+ "surface/form-grey-weak-a": {
1106
+ "dark": "#b3b3b314",
1107
+ "light": "#6666661f"
1108
+ },
1109
+ "surface/form-inverted": {
1110
+ "dark": "#f7f7f7",
1111
+ "light": "#151515"
1112
+ },
1113
+ "surface/form-inverted-deep": {
1114
+ "dark": "#ffffff",
1115
+ "light": "#000000"
1116
+ },
1117
+ "surface/form-primary-a": {
1118
+ "dark": "#ffffff0f",
1119
+ "light": "#0000000f"
1120
+ },
1121
+ "surface/form-red": {
1122
+ "dark": "#ff4747",
1123
+ "light": "#ff4a40"
1124
+ },
1125
+ "surface/form-red-weak-a": {
1126
+ "dark": "#ff47471f",
1127
+ "light": "#ff4a4026"
1128
+ },
1129
+ "surface/form-secondary-a": {
1130
+ "dark": "#ffffff0a",
1131
+ "light": "#0000000a"
1132
+ },
1133
+ "surface/form-yellow": {
1134
+ "dark": "#f5b625",
1135
+ "light": "#f29900"
1136
+ },
1137
+ "surface/form-yellow-weak-a": {
1138
+ "dark": "#f5b62514",
1139
+ "light": "#f299001f"
1140
+ },
1141
+ "text/blue": {
1142
+ "dark": "#0090ff",
1143
+ "light": "#148aff"
1144
+ },
1145
+ "text/green": {
1146
+ "dark": "#0be06f",
1147
+ "light": "#00b84d"
1148
+ },
1149
+ "text/grey": {
1150
+ "dark": "#b3b3b3",
1151
+ "light": "#666666"
1152
+ },
1153
+ "text/invert-a": {
1154
+ "dark": "#000000ed",
1155
+ "light": "#ffffffed"
1156
+ },
1157
+ "text/primary": {
1158
+ "dark": "#eeeeee",
1159
+ "light": "#151515"
1160
+ },
1161
+ "text/primary-a": {
1162
+ "dark": "#ffffffed",
1163
+ "light": "#000000ed"
1164
+ },
1165
+ "text/quaternary": {
1166
+ "dark": "#777777",
1167
+ "light": "#999999"
1168
+ },
1169
+ "text/quaternary-a": {
1170
+ "dark": "#ffffff80",
1171
+ "light": "#00000080"
1172
+ },
1173
+ "text/red": {
1174
+ "dark": "#ff4747",
1175
+ "light": "#ff4a40"
1176
+ },
1177
+ "text/secondary": {
1178
+ "dark": "#bababa",
1179
+ "light": "#454545"
1180
+ },
1181
+ "text/secondary-a": {
1182
+ "dark": "#ffffffba",
1183
+ "light": "#000000ba"
1184
+ },
1185
+ "text/tertiary": {
1186
+ "dark": "#999999",
1187
+ "light": "#666666"
1188
+ },
1189
+ "text/tertiary-a": {
1190
+ "dark": "#ffffff99",
1191
+ "light": "#00000099"
1192
+ },
1193
+ "text/yellow": {
1194
+ "dark": "#f5b625",
1195
+ "light": "#f29900"
1196
+ }
1197
+ };
1198
+ var flatColors = {
1199
+ "always/avatar-bg01": "#aa47bc",
1200
+ "always/avatar-bg02": "#7a1fa2",
1201
+ "always/avatar-bg03": "#7e57c2",
1202
+ "always/avatar-bg04": "#512da7",
1203
+ "always/avatar-bg05": "#5c6bc0",
1204
+ "always/avatar-bg06": "#0288d1",
1205
+ "always/avatar-bg07": "#00579c",
1206
+ "always/avatar-bg08": "#0098a6",
1207
+ "always/avatar-bg09": "#00887a",
1208
+ "always/avatar-bg10": "#689f39",
1209
+ "always/avatar-bg11": "#33691e",
1210
+ "always/avatar-bg12": "#004c3f",
1211
+ "always/avatar-bg13": "#ec407a",
1212
+ "always/avatar-bg14": "#c2175b",
1213
+ "always/avatar-bg15": "#bf360c",
1214
+ "always/avatar-bg16": "#f5511e",
1215
+ "always/avatar-bg17": "#ef6c00",
1216
+ "always/avatar-bg18": "#8c6e63",
1217
+ "always/avatar-bg19": "#5d4038",
1218
+ "always/avatar-bg20": "#78909c",
1219
+ "always/avatar-bg21": "#465a65",
1220
+ "always/black006-a": "#0000000f",
1221
+ "always/black010-a": "#0000001a",
1222
+ "always/black015-a": "#00000026",
1223
+ "always/black020-a": "#00000033",
1224
+ "always/black030-a": "#0000004d",
1225
+ "always/black050-a": "#00000080",
1226
+ "always/black060-a": "#00000099",
1227
+ "always/black080-a": "#000000cc",
1228
+ "always/black100": "#000000",
1229
+ "always/grey-strong": "#232323",
1230
+ "always/grey085": "#5c5c5c",
1231
+ "always/lightgrey006-a": "#9999990f",
1232
+ "always/lightgrey010-a": "#9999991a",
1233
+ "always/lightgrey015-a": "#99999926",
1234
+ "always/lightgrey020-a": "#99999933",
1235
+ "always/lightgrey030-a": "#9999994d",
1236
+ "always/lightgrey050-a": "#99999980",
1237
+ "always/lightgrey080-a": "#999999cc",
1238
+ "always/lightgrey100": "#999999",
1239
+ "always/palette05": "linear-gradient(135deg, #db2667 0%, #f4a368 100%)",
1240
+ "always/service-live-pop": "#df3868",
1241
+ "always/service-live-red": "#ff0000",
1242
+ "always/service-mnet": "#ff477f",
1243
+ "always/service-mnetapp": "#ff477f",
1244
+ "always/service-point": "linear-gradient(135deg, #1cac3c 0%, #1ca6bb 100%)",
1245
+ "always/service-pop-ing": "linear-gradient(135deg, #db2667 0%, #f4a368 100%)",
1246
+ "always/service-popgrey-weak-a": "#707ca00f",
1247
+ "always/service-post-thumb-a": "#aa89f5cc",
1248
+ "always/service-rankingpoll-thumb-a": "#FFADDD80",
1249
+ "always/service-red080-a": "#f5254acc",
1250
+ "always/service-survey": "#597eff",
1251
+ "always/service-survey-thumb-a": "#7192f5cc",
1252
+ "always/service-ticket": "#00bf59",
1253
+ "always/white006-a": "#ffffff0f",
1254
+ "always/white010-a": "#ffffff1a",
1255
+ "always/white015-a": "#ffffff26",
1256
+ "always/white020-a": "#ffffff33",
1257
+ "always/white030-a": "#ffffff4d",
1258
+ "always/white050-a": "#ffffff80",
1259
+ "always/white060-a": "#ffffff99",
1260
+ "always/white080-a": "#ffffffcc",
1261
+ "always/white100": "#ffffff",
1262
+ "auto/icon-primary-on-dark": "#ffffff",
1263
+ "auto/icon-primary-on-light": "#000000ed",
1264
+ "auto/icon-secondary-on-dark": "#ffffff",
1265
+ "auto/icon-secondary-on-light": "#000000ba",
1266
+ "auto/text-primary-on-dark": "#ffffff",
1267
+ "auto/text-primary-on-light": "#000000",
1268
+ "auto/text-secondary-on-dark": "#ffffffcc",
1269
+ "auto/text-secondary-on-light": "#000000cc",
1270
+ "picker/button": "#654bff",
1271
+ "picker/button-weak-a": "#654bff26",
1272
+ "picker/on-button": "#ffffff",
1273
+ "picker/star": "#7266ff",
1274
+ "pop/bg-tl01": "#c9d0ea",
1275
+ "pop/bg-tl02": "#f2de6f",
1276
+ "pop/bg-tl03": "#fca783",
1277
+ "pop/bg-tl04": "#a0dda6",
1278
+ "pop/bg-tl05": "#a2bce3",
1279
+ "pop/bg-tl06": "#f7b3cf",
1280
+ "pop/bg-tl07": "#bfa2e3",
1281
+ "pop/bg-tl08": "#fb8686",
1282
+ "pop/bg-tl09": "#eec2c2",
1283
+ "pop/bg-tl10": "#e2d1b0",
1284
+ "pop/bubble-tl01": "#7984b1",
1285
+ "pop/bubble-tl03": "#e3703f",
1286
+ "pop/bubble-tl04": "#5fac70",
1287
+ "pop/bubble-tl05": "#587ab1",
1288
+ "pop/bubble-tl06": "#ca7094",
1289
+ "pop/bubble-tl07": "#8067b5",
1290
+ "pop/bubble-tl08": "#cb4e4e",
1291
+ "pop/bubble-tl09": "#cb8181",
1292
+ "pop/bubble-tl1": "#a79272",
1293
+ "pop/item-gradient01": "linear-gradient(135deg, #fbf3ac 0%, #ffe1fc 100%)",
1294
+ "pop/item-gradient02": "linear-gradient(135deg, #cbe6ff 0%, #d5ffdf 100%)",
1295
+ "pop/item-gradient03": "linear-gradient(135deg, #e4ceff 0%, #ffe4cc 100%)",
1296
+ "pop/item-gradient04": "linear-gradient(135deg, #ffdcb3 0%, #c9f8ff 100%)",
1297
+ "pop/item-gradient05": "linear-gradient(135deg, #ffd0ec 0%, #d3fcff 100%)",
1298
+ "pop/item-gradient06": "linear-gradient(135deg, #feb5b5 0%, #d6fee1 100%)"
1299
+ };
1300
+ var shadowTokens = {
1301
+ "shadow/default-large": {
1302
+ "dark": "0px 1px 2px 0px #00000033, 0px 8px 48px 0px #00000099",
1303
+ "light": "0px 1px 2px 0px #1a1a1a05, 0px 8px 48px 0px #1a1a1a26"
1304
+ },
1305
+ "shadow/default-medium": {
1306
+ "dark": "0px 1px 2px 0px #00000033, 0px 4px 24px 0px #00000066",
1307
+ "light": "0px 1px 2px 0px #00000005, 0px 4px 24px 0px #1a1a1a1a"
1308
+ },
1309
+ "shadow/default-small": {
1310
+ "dark": "0px 1px 2px 0px #0000001a, 0px 2px 8px 0px #00000066",
1311
+ "light": "0px 1px 2px 0px #1a1a1a05, 0px 2px 8px 0px #1a1a1a1a"
1312
+ },
1313
+ "shadow/default-xlarge": {
1314
+ "dark": "0px 1px 2px 0px #00000033, 0px 16px 72px 0px #00000099",
1315
+ "light": "0px 1px 2px 0px #1a1a1a05, 0px 16px 72px 0px #1a1a1a26"
1316
+ },
1317
+ "shadow/default-xsmall": {
1318
+ "dark": "0px 1px 2px 0px #00000033, 0px 0px 4px 0px #00000066",
1319
+ "light": "0px 1px 2px 0px #1a1a1a05, 0px 0px 4px 0px #1a1a1a26"
1320
+ },
1321
+ "shadow/weak-large": {
1322
+ "dark": "0px 1px 2px 0px #0000001a, 0px 8px 48px 0px #00000066",
1323
+ "light": "0px 1px 2px 0px #1a1a1a05, 0px 8px 48px 0px #1a1a1a1f"
1324
+ },
1325
+ "shadow/weak-medium": {
1326
+ "dark": "0px 1px 2px 0px #0000001a, 0px 4px 24px 0px #00000033",
1327
+ "light": "0px 1px 2px 0px #00000005, 0px 4px 20px 0px #1a1a1a14"
1328
+ },
1329
+ "shadow/weak-small": {
1330
+ "dark": "0px 1px 2px 0px #0000001a, 0px 2px 8px 0px #00000033",
1331
+ "light": "0px 1px 2px 0px #1a1a1a05, 0px 2px 8px 0px #1a1a1a14"
1332
+ },
1333
+ "shadow/weak-xlarge": {
1334
+ "dark": "0px 1px 2px 0px #0000001a, 0px 16px 72px 0px #00000066",
1335
+ "light": "0px 1px 2px 0px #1a1a1a05, 0px 16px 72px 0px #1a1a1a1f"
1336
+ },
1337
+ "shadow/weak-xsmall": {
1338
+ "dark": "0px 1px 2px 0px #0000001a, 0px 0px 4px 0px #00000033",
1339
+ "light": "0px 1px 1px 0px #1a1a1a05, 0px 0px 4px 0px #1a1a1a14"
1340
+ }
1341
+ };
1342
+ var fontFamily = "'Pretendard Variable', Pretendard, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, 'Noto Sans', sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol', 'Noto Color Emoji'";
1343
+ function cssVarName(slug, prefix, kind) {
1344
+ const s = slug.replace(/\//g, "-");
1345
+ return kind === "mode" ? `--${prefix}-mode-${s}` : `--${prefix}-${s}`;
1346
+ }
1347
+ function cssVarRef(slug, prefix, kind) {
1348
+ return `var(${cssVarName(slug, prefix, kind)})`;
1349
+ }
1350
+ function buildColorTree(modeColors2, flatColors2, prefix) {
1351
+ const tree = {};
1352
+ const add = (slug, kind) => {
1353
+ const [cat, ...rest] = slug.split("/");
1354
+ const leaf = rest.join("/").replace(/\//g, "-") || cat;
1355
+ (tree[cat] ?? (tree[cat] = {}))[leaf] = cssVarRef(slug, prefix, kind);
1356
+ };
1357
+ for (const slug of Object.keys(modeColors2)) add(slug, "mode");
1358
+ for (const slug of Object.keys(flatColors2)) add(slug, "flat");
1359
+ return tree;
1360
+ }
1361
+ function buildShadowRefs(shadowTokens2, prefix) {
1362
+ const out = {};
1363
+ for (const slug of Object.keys(shadowTokens2)) {
1364
+ const leaf = slug.replace(/^shadow\//, "");
1365
+ out[leaf] = cssVarRef(slug, prefix, "mode");
1366
+ }
1367
+ return out;
1368
+ }
1369
+ function colorLines(t, prefix, mode) {
1370
+ return [
1371
+ ...Object.entries(t.modeColors).map(
1372
+ ([slug, pair]) => ` ${cssVarName(slug, prefix, "mode")}: ${pair[mode]};`
1373
+ ),
1374
+ ...Object.entries(t.shadowTokens).map(
1375
+ ([slug, pair]) => ` ${cssVarName(slug, prefix, "mode")}: ${pair[mode]};`
1376
+ )
1377
+ ].join("\n");
1378
+ }
1379
+ function renderFallbackCss(t, opts) {
1380
+ const p = opts.prefix;
1381
+ const flat = Object.entries(t.flatColors).map(([slug, v]) => ` ${cssVarName(slug, p, "flat")}: ${v};`).join("\n");
1382
+ const lightColors = colorLines(t, p, "light");
1383
+ const frame = opts.target === "frame";
1384
+ const header = frame ? `/* bstage \uB514\uC790\uC778 \uD1A0\uD070 \u2014 \uACA9\uB9AC \uD504\uB808\uC784 (${p}). \uD638\uC2A4\uD2B8 :root\uB97C \uC0C1\uC18D\uD558\uC9C0 \uBABB\uD558\uB294 \uD504\uB808\uC784 \uBB38\uC11C\uC6A9 */` : `/* ================================================================
1385
+ * bstage \uB514\uC790\uC778 \uD1A0\uD070 \u2014 dev fallback (${p})
1386
+ * @bstage-sdk/design \uC0DD\uC131\uBB3C. \uAC1C\uBC1C/\uBBF8\uB9AC\uBCF4\uAE30 \uC804\uC6A9(:root fallback).
1387
+ * \uBC30\uD3EC \uC2DC\uC5D4 \uD50C\uB7AB\uD3FC :root \uAC12\uC744 \uC0C1\uC18D\uD558\uBA70 \uC774 \uD30C\uC77C\uC740 \uBC88\uB4E4\uB418\uC9C0 \uC54A\uB294\uB2E4.
1388
+ * ================================================================ */`;
1389
+ let css = `${header}
1390
+
1391
+ :root {
1392
+ ${lightColors}
1393
+
1394
+ ${flat}
1395
+
1396
+ --${p}-font-family: ${t.fontFamily};
1397
+ }
1398
+ `;
1399
+ if (opts.dark) {
1400
+ const darkColors = colorLines(t, p, "dark");
1401
+ if (!frame) {
1402
+ css += `
1403
+ @media (prefers-color-scheme: dark) {
1404
+ :root:not([data-bspoke="light"]) {
1405
+ ${darkColors.replace(/^ {2}/gm, " ")}
1406
+ }
1407
+ }
1408
+ `;
1409
+ }
1410
+ css += `
1411
+ :root[data-bspoke="dark"],
1412
+ :root.dark {
1413
+ ${darkColors}
1414
+ }
1415
+ `;
1416
+ }
1417
+ return css;
1418
+ }
1419
+ var PREFIX = "user";
1420
+ var color = buildColorTree(modeColors, flatColors, PREFIX);
1421
+ var shadow = buildShadowRefs(shadowTokens, PREFIX);
1422
+ function renderFrameCss() {
1423
+ return renderFallbackCss(
1424
+ { modeColors, flatColors, shadowTokens, fontFamily },
1425
+ { prefix: PREFIX, dark: true, target: "frame" }
1426
+ );
1427
+ }
1428
+
870
1429
  // src/srcdoc/createSrcdoc.ts
1430
+ var FRAME_TOKEN_CSS = renderFrameCss();
871
1431
  var MAX_MEDIA_ORIGINS = 20;
872
1432
  var REPORT_FLUSH_DELAY_MS = 1e3;
873
1433
  var MAX_ELEMENT_NAME_LENGTH = 100;
@@ -948,6 +1508,14 @@ function bootstrapScript(o) {
948
1508
  ` maxCount: ${REPORT_COUNT_MAX},`,
949
1509
  ` flushDelayMs: ${REPORT_FLUSH_DELAY_MS}`,
950
1510
  "});",
1511
+ // 호스트 테마를 프레임 문서에 반영한다(토큰 CSS의 `:root.dark`). 템플릿 코드보다 먼저 구독한다.
1512
+ "function applyTheme(theme) {",
1513
+ " var root = document.documentElement;",
1514
+ " if (!theme || typeof theme.dark !== 'boolean' || !root || !root.classList) return;",
1515
+ " root.classList.toggle('dark', theme.dark);",
1516
+ "}",
1517
+ "client.on('theme', applyTheme);",
1518
+ "client.ready.then(function (init) { applyTheme(init && init.theme); }, function () {});",
951
1519
  "var lastHeight = -1;",
952
1520
  "var scheduled = false;",
953
1521
  "function reportHeight() {",
@@ -1004,6 +1572,9 @@ function createSrcdoc(options) {
1004
1572
  if (/<\/script|<!--/i.test(script)) {
1005
1573
  throw new Error("[bstage-bridge] \uBD80\uD2B8\uC2A4\uD2B8\uB7A9 \uC2A4\uD06C\uB9BD\uD2B8\uC5D0 \uC2A4\uD06C\uB9BD\uD2B8 \uC885\uB8CC \uC2DC\uD000\uC2A4\uAC00 \uC788\uC2B5\uB2C8\uB2E4");
1006
1574
  }
1575
+ if (/<\/style|<!--/i.test(FRAME_TOKEN_CSS)) {
1576
+ throw new Error("[bstage-bridge] \uB514\uC790\uC778 \uD1A0\uD070 CSS\uC5D0 \uC2A4\uD0C0\uC77C \uC885\uB8CC \uC2DC\uD000\uC2A4\uAC00 \uC788\uC2B5\uB2C8\uB2E4");
1577
+ }
1007
1578
  return [
1008
1579
  "<!doctype html>",
1009
1580
  "<html>",
@@ -1014,7 +1585,10 @@ function createSrcdoc(options) {
1014
1585
  `<title>${escapeHtml(title)}</title>`,
1015
1586
  // body 높이를 콘텐츠 높이로 잰다 — documentElement.scrollHeight는 뷰포트 이상이라 줄어들지 못한다.
1016
1587
  // flow-root는 자식 margin이 body 밖으로 접혀 나가 높이에서 빠지는 것을 막는다.
1017
- "<style>html,body{margin:0;padding:0;background:transparent;height:auto}body{display:flow-root}</style>",
1588
+ `<style>${FRAME_TOKEN_CSS}</style>`,
1589
+ // 글자색·글꼴은 호스트와 같은 토큰(inline 배치가 상속받던 값). 배경은 투명 — 호스트 배경이 비친다.
1590
+ // color-scheme은 두지 않는다 — 호스트도 두지 않으며, 다르면 브라우저가 iframe 캔버스를 불투명하게 칠한다.
1591
+ "<style>html,body{margin:0;padding:0;background:transparent;height:auto}body{display:flow-root;color:var(--user-mode-text-primary);font-family:var(--user-font-family)}</style>",
1018
1592
  `<script nonce="${escapeHtml(nonce)}">
1019
1593
  ${script}
1020
1594
  </script>`,
@@ -1025,6 +1599,7 @@ ${script}
1025
1599
  }
1026
1600
  // Annotate the CommonJS export names for ESM import in node:
1027
1601
  0 && (module.exports = {
1602
+ ACCOUNT_SESSION_CAPABILITY,
1028
1603
  BRIDGE_ERROR_CODES,
1029
1604
  BRIDGE_NAMESPACE,
1030
1605
  BRIDGE_SURFACES,
@@ -1034,10 +1609,12 @@ ${script}
1034
1609
  HOST_EVENT_TYPES,
1035
1610
  IFRAME_ATTRIBUTES,
1036
1611
  INIT_RESPONSE,
1612
+ KNOWN_CAPABILITIES,
1037
1613
  MAX_ELEMENT_NAME_LENGTH,
1038
1614
  MAX_ENVELOPE_ID_LENGTH,
1039
1615
  MAX_ENVELOPE_TYPE_LENGTH,
1040
1616
  MAX_MEDIA_ORIGINS,
1617
+ OTP_OPS,
1041
1618
  READY_EVENT,
1042
1619
  REPORTS_PER_SESSION,
1043
1620
  REPORT_COUNT_MAX,
@@ -1047,6 +1624,7 @@ ${script}
1047
1624
  REPORT_MESSAGE_MAX_LENGTH,
1048
1625
  REQUEST_TIMEOUT_MS,
1049
1626
  REQUEST_TYPES,
1627
+ SESSION_OPS,
1050
1628
  TEMPLATE_REPORT_KINDS,
1051
1629
  buildFrameCsp,
1052
1630
  createEnvelope,
package/dist/index.d.cts CHANGED
@@ -1,4 +1,4 @@
1
- export { B as BRIDGE_ERROR_CODES, a as BRIDGE_SURFACES, b as BridgeError, c as BridgeErrorCode, d as BridgeErrorLike, e as BridgeEventMap, f as BridgeHostEventType, g as BridgeInit, h as BridgeLimits, i as BridgeRequestMap, j as BridgeRequestType, k as BridgeResult, l as BridgeSurface, m as BridgeTranslations, F as FRAME_UNLOAD_EVENT, n as FetchRequest, o as FetchResult, H as HOST_EVENT_TYPES, I as IFRAME_ATTRIBUTES, p as INIT_RESPONSE, L as LogLevel, M as MemberState, R as READY_EVENT, q as REPORTS_PER_SESSION, r as REPORT_COUNT_MAX, s as REPORT_FRAME_MAX_LENGTH, t as REPORT_MAX_FRAMES, u as REPORT_MESSAGE_MAX_LENGTH, v as REQUEST_TIMEOUT_MS, w as REQUEST_TYPES, S as SlotState, x as StorageOp, T as TEMPLATE_REPORT_KINDS, y as TemplateReport, z as TemplateReportKind, A as ThemeState, C as ToastKind, W as WithSession, D as isBridgeErrorCode, E as isBridgeErrorLike, G as isBridgeSurface, J as isHostEventType, K as isRequestType } from './messages-Cdjpvu2S.cjs';
1
+ export { A as ACCOUNT_SESSION_CAPABILITY, a as AccountHostQuery, b as AccountSpaceInfo, B as BRIDGE_ERROR_CODES, c as BRIDGE_SURFACES, d as BridgeError, e as BridgeErrorCode, f as BridgeErrorLike, g as BridgeEventMap, h as BridgeHostEventType, i as BridgeInit, j as BridgeLimits, k as BridgeRequestMap, l as BridgeRequestType, m as BridgeResult, n as BridgeSurface, o as BridgeTranslations, F as FRAME_UNLOAD_EVENT, p as FetchRequest, q as FetchResult, H as HOST_EVENT_TYPES, I as IFRAME_ATTRIBUTES, r as INIT_RESPONSE, K as KNOWN_CAPABILITIES, L as LogLevel, M as MemberState, N as NavigateOptions, O as OTP_OPS, s as OtpOp, t as OtpPurpose, u as OtpRequest, v as OtpResult, R as READY_EVENT, w as REPORTS_PER_SESSION, x as REPORT_COUNT_MAX, y as REPORT_FRAME_MAX_LENGTH, z as REPORT_MAX_FRAMES, C as REPORT_MESSAGE_MAX_LENGTH, D as REQUEST_TIMEOUT_MS, E as REQUEST_TYPES, G as ReverificationStatus, S as SESSION_OPS, J as SessionOp, P as SessionRequest, Q as SessionResult, T as SlotState, U as StorageOp, V as TEMPLATE_REPORT_KINDS, W as TemplateReport, X as TemplateReportKind, Y as ThemeState, Z as ToastKind, _ as WithSession, $ as isBridgeErrorCode, a0 as isBridgeErrorLike, a1 as isBridgeSurface, a2 as isHostEventType, a3 as isRequestType } from './messages-_p1yCNj9.cjs';
2
2
  export { C as CreateSrcdocOptions, M as MAX_ELEMENT_NAME_LENGTH, a as MAX_MEDIA_ORIGINS, R as REPORT_FLUSH_DELAY_MS, b as buildFrameCsp, c as createNonce, d as createSession, e as createSrcdoc, i as isValidNonce, f as isValidSession } from './createSrcdoc-DYZk6dDJ.cjs';
3
3
 
4
4
  /** 봉투 버전. 형식이 하위 호환되지 않게 바뀔 때만 올린다. */