@breakside/jskit 2022.29.0 → 2022.32.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 (48) hide show
  1. package/Frameworks/DOM.jsframework/Info.json +2 -2
  2. package/Frameworks/DOM.jsframework/io.breakside.JSKit.DOM-bundle.js +2 -2
  3. package/Frameworks/FontKit.jsframework/Info.json +2 -2
  4. package/Frameworks/FontKit.jsframework/io.breakside.JSKit.FontKit-bundle.js +2 -2
  5. package/Frameworks/Foundation.jsframework/Info.json +2 -2
  6. package/Frameworks/Foundation.jsframework/JS/JSTextTypesetter.js +2 -3
  7. package/Frameworks/Foundation.jsframework/JS/JSTimeZone.js +11 -4
  8. package/Frameworks/Foundation.jsframework/JS/String+JS.js +367 -0
  9. package/Frameworks/Foundation.jsframework/JS/UnicodeChar.js +283 -1
  10. package/Frameworks/Foundation.jsframework/JS/UnicodeProperties.js +12 -0
  11. package/Frameworks/Foundation.jsframework/io.breakside.JSKit.Foundation-bundle.js +2 -2
  12. package/Frameworks/SecurityKit.jsframework/Info.json +2 -2
  13. package/Frameworks/SecurityKit.jsframework/io.breakside.JSKit.SecurityKit-bundle.js +2 -2
  14. package/Info.json +2 -2
  15. package/Node/HTMLBuilder.js +1 -1
  16. package/Node/io.breakside.jskit-bundle.js +2 -2
  17. package/Root/Frameworks/APIKit/Info.yaml +1 -1
  18. package/Root/Frameworks/APIKitTesting/Info.yaml +1 -1
  19. package/Root/Frameworks/AuthKit/Info.yaml +1 -1
  20. package/Root/Frameworks/CSSOM/Info.yaml +1 -1
  21. package/Root/Frameworks/ChartKit/Info.yaml +1 -1
  22. package/Root/Frameworks/ConferenceKit/Info.yaml +1 -1
  23. package/Root/Frameworks/DBKit/Info.yaml +1 -1
  24. package/Root/Frameworks/DOM/Info.yaml +1 -1
  25. package/Root/Frameworks/Dispatch/Info.yaml +1 -1
  26. package/Root/Frameworks/FontKit/Info.yaml +1 -1
  27. package/Root/Frameworks/Foundation/Info.yaml +1 -1
  28. package/Root/Frameworks/Foundation/JSTextTypesetter.js +2 -3
  29. package/Root/Frameworks/Foundation/JSTimeZone.js +11 -4
  30. package/Root/Frameworks/Foundation/String+JS.js +367 -0
  31. package/Root/Frameworks/Foundation/UnicodeChar.js +283 -1
  32. package/Root/Frameworks/Foundation/UnicodeProperties.js +12 -0
  33. package/Root/Frameworks/ImageKit/Info.yaml +1 -1
  34. package/Root/Frameworks/MediaKit/Info.yaml +1 -1
  35. package/Root/Frameworks/MediaKitUI/Info.yaml +1 -1
  36. package/Root/Frameworks/NotificationKit/Info.yaml +1 -1
  37. package/Root/Frameworks/PDFKit/Info.yaml +1 -1
  38. package/Root/Frameworks/QRKit/Info.yaml +1 -1
  39. package/Root/Frameworks/SearchKit/Info.yaml +1 -1
  40. package/Root/Frameworks/SecurityKit/Info.yaml +1 -1
  41. package/Root/Frameworks/ServerKit/Info.yaml +1 -1
  42. package/Root/Frameworks/ServerKitTesting/Info.yaml +1 -1
  43. package/Root/Frameworks/TestKit/Info.yaml +1 -1
  44. package/Root/Frameworks/UIKit/Info.yaml +1 -1
  45. package/Root/Frameworks/UIKit/UIHTMLTextTypesetter.js +2 -2
  46. package/Root/Frameworks/UIKit/UISlider.js +1 -1
  47. package/Root/Frameworks/UIKitTesting/Info.yaml +1 -1
  48. package/package.json +1 -1
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "JSBundleType": "framework",
3
3
  "JSBundleIdentifier": "io.breakside.JSKit.DOM",
4
- "JSBundleVersion": "2022.29.0",
4
+ "JSBundleVersion": "2022.32.0",
5
5
  "JSDevelopmentLanguage": "en",
6
6
  "JSCopyright": "Copyright © 2020 Breakside Inc.",
7
7
  "JSBundleEnvironments": {
@@ -9,5 +9,5 @@
9
9
  "node": "DOM+Node.js"
10
10
  },
11
11
  "JSLicenseNotice": "Licensed under the Breakside Public License, Version 1.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nIf a copy of the License was not distributed with this file, you may\nobtain a copy at\n\n http://breakside.io/licenses/LICENSE-1.0.txt\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n",
12
- "GitRevision": "706355b5640557cd87bd309e39fde15ded8dbe3c"
12
+ "GitRevision": "cbb5e59ea56e128f63991d01fbd9275414b8937d"
13
13
  }
@@ -3,7 +3,7 @@ JSBundle.bundles['io.breakside.JSKit.DOM'] = {
3
3
  "Info": {
4
4
  "JSBundleType": "framework",
5
5
  "JSBundleIdentifier": "io.breakside.JSKit.DOM",
6
- "JSBundleVersion": "2022.29.0",
6
+ "JSBundleVersion": "2022.32.0",
7
7
  "JSDevelopmentLanguage": "en",
8
8
  "JSCopyright": "Copyright © 2020 Breakside Inc.",
9
9
  "JSBundleEnvironments": {
@@ -11,7 +11,7 @@ JSBundle.bundles['io.breakside.JSKit.DOM'] = {
11
11
  "node": "DOM+Node.js"
12
12
  },
13
13
  "JSLicenseNotice": "Licensed under the Breakside Public License, Version 1.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nIf a copy of the License was not distributed with this file, you may\nobtain a copy at\n\n http://breakside.io/licenses/LICENSE-1.0.txt\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n",
14
- "GitRevision": "706355b5640557cd87bd309e39fde15ded8dbe3c"
14
+ "GitRevision": "cbb5e59ea56e128f63991d01fbd9275414b8937d"
15
15
  },
16
16
  "Resources": [],
17
17
  "ResourceLookup": {
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "JSBundleType": "framework",
3
3
  "JSBundleIdentifier": "io.breakside.JSKit.FontKit",
4
- "JSBundleVersion": "2022.29.0",
4
+ "JSBundleVersion": "2022.32.0",
5
5
  "JSDevelopmentLanguage": "en",
6
6
  "JSCopyright": "Copyright © 2020 Breakside Inc.",
7
7
  "JSBundleEnvironments": {
8
8
  "html": "FontKit+HTML.js"
9
9
  },
10
10
  "JSLicenseNotice": "Licensed under the Breakside Public License, Version 1.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nIf a copy of the License was not distributed with this file, you may\nobtain a copy at\n\n http://breakside.io/licenses/LICENSE-1.0.txt\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n",
11
- "GitRevision": "706355b5640557cd87bd309e39fde15ded8dbe3c"
11
+ "GitRevision": "cbb5e59ea56e128f63991d01fbd9275414b8937d"
12
12
  }
@@ -3,14 +3,14 @@ JSBundle.bundles['io.breakside.JSKit.FontKit'] = {
3
3
  "Info": {
4
4
  "JSBundleType": "framework",
5
5
  "JSBundleIdentifier": "io.breakside.JSKit.FontKit",
6
- "JSBundleVersion": "2022.29.0",
6
+ "JSBundleVersion": "2022.32.0",
7
7
  "JSDevelopmentLanguage": "en",
8
8
  "JSCopyright": "Copyright © 2020 Breakside Inc.",
9
9
  "JSBundleEnvironments": {
10
10
  "html": "FontKit+HTML.js"
11
11
  },
12
12
  "JSLicenseNotice": "Licensed under the Breakside Public License, Version 1.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nIf a copy of the License was not distributed with this file, you may\nobtain a copy at\n\n http://breakside.io/licenses/LICENSE-1.0.txt\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n",
13
- "GitRevision": "706355b5640557cd87bd309e39fde15ded8dbe3c"
13
+ "GitRevision": "cbb5e59ea56e128f63991d01fbd9275414b8937d"
14
14
  },
15
15
  "Resources": [],
16
16
  "ResourceLookup": {
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "JSBundleType": "framework",
3
3
  "JSBundleIdentifier": "io.breakside.JSKit.Foundation",
4
- "JSBundleVersion": "2022.29.0",
4
+ "JSBundleVersion": "2022.32.0",
5
5
  "JSDevelopmentLanguage": "en",
6
6
  "JSCopyright": "Copyright © 2020 Breakside Inc.",
7
7
  "JSBundleEnvironments": {
@@ -9,5 +9,5 @@
9
9
  "node": "Foundation+Node.js"
10
10
  },
11
11
  "JSLicenseNotice": "Licensed under the Breakside Public License, Version 1.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nIf a copy of the License was not distributed with this file, you may\nobtain a copy at\n\n http://breakside.io/licenses/LICENSE-1.0.txt\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n",
12
- "GitRevision": "706355b5640557cd87bd309e39fde15ded8dbe3c"
12
+ "GitRevision": "cbb5e59ea56e128f63991d01fbd9275414b8937d"
13
13
  }
@@ -247,11 +247,10 @@ JSClass("JSTextTypesetter", JSObject, {
247
247
 
248
248
  if (lineBreakMode == JSLineBreakMode.wordWrap){
249
249
  // word wrapping
250
-
251
250
  iterator.decrement();
252
251
  var characterBreakLocation = iterator.range.location;
253
- // back up to a word boundary
254
- while (iterator.index > range.location && !iterator.isWordBoundary){
252
+ // back up to a line break opportunity
253
+ while (iterator.index > range.location && !iterator.isLineBreakOpportunity){
255
254
  iterator.decrement();
256
255
  }
257
256
  if (iterator.range.location <= range.location){
@@ -25,15 +25,19 @@
25
25
  JSClass("JSTimeZone", JSObject, {
26
26
 
27
27
  initWithIdentifier: function(identifier){
28
+ if (identifier === null || identifier === undefined){
29
+ return null;
30
+ }
28
31
  var lookup = zoneinfo.map[identifier];
29
32
  if (lookup === undefined){
30
33
  return null;
31
34
  }
32
35
  if (zoneinfo.tzif !== undefined){
33
36
  var tzif = zoneinfo.tzif.subdataInRange(JSRange(lookup[0], lookup[1]));
34
- return this.initWithData(tzif);
37
+ return this.initWithData(tzif, identifier);
35
38
  }
36
39
  var zone = zoneinfo.zones[lookup.index];
40
+ this._identifier = identifier;
37
41
  this._transitionTimes = zone.transitions;
38
42
  this._transitionTimesToLocalTimeTypes = zone.map;
39
43
  this._localTimeTypes = zone.types;
@@ -49,12 +53,14 @@ JSClass("JSTimeZone", JSObject, {
49
53
  this._fixedAbbreviation = abbreviation;
50
54
  },
51
55
 
52
- initWithData: function(data){
56
+ initWithData: function(data, identifier){
53
57
  // https://www.man7.org/linux/man-pages/man5/tzfile.5.html
54
58
  if (!(data instanceof JSData)){
55
59
  return null;
56
60
  }
57
61
 
62
+ this._identifier = identifier;
63
+
58
64
  var dataLength = data.length;
59
65
 
60
66
  // Header is 44 bytes
@@ -205,6 +211,7 @@ JSClass("JSTimeZone", JSObject, {
205
211
  this._defaultTimeTypeIndex = this._getDefaultTimeTypeIndex();
206
212
  },
207
213
 
214
+ identifier: JSReadOnlyProperty("_identifier", null),
208
215
  _fixedOffset: null,
209
216
  _fixedAbbreviation: null,
210
217
  _transitionTimes: null,
@@ -526,8 +533,8 @@ JSClass("JSTimeZone", JSObject, {
526
533
 
527
534
  });
528
535
 
529
- JSTimeZone.changeLocalTimeZone = function(identifer){
530
- localIdentifier = identifer;
536
+ JSTimeZone.changeLocalTimeZone = function(identifier){
537
+ localIdentifier = identifier;
531
538
  Object.defineProperty(JSTimeZone, 'local', defaultLocalProperty);
532
539
  };
533
540
 
@@ -1022,6 +1022,366 @@ Object.defineProperties(UnicodeIterator.prototype, {
1022
1022
  return this.character !== null && (this.character.code == 0x20 || this.character.code == 0x09 || this.character.code == 0x0A || this.character.code == 0x0B || this.character.code == 0x0C || this.character.code == 0x0D);
1023
1023
  // TODO: consider other whitespace
1024
1024
  }
1025
+ },
1026
+
1027
+ isLineBreakOpportunity: {
1028
+ enumerable: false,
1029
+ get: function UnicodeIterator_isLineBreakOpportunity(){
1030
+ // https://www.unicode.org/reports/tr14/
1031
+ var before = UnicodeIterator(this);
1032
+ before.decrement();
1033
+ var lbc = UnicodeChar.LineBreakingClass;
1034
+
1035
+ // LB2 Never break at the start of text.
1036
+ if (before._character === null){
1037
+ return false;
1038
+ }
1039
+
1040
+ // LB3 Always break at the end of text.
1041
+ if (this._character === null){
1042
+ return true;
1043
+ }
1044
+
1045
+ var c1 = this._character.lineBreakingClass;
1046
+ var c0 = before._character.lineBreakingClass;
1047
+
1048
+ // LB4 Always break after hard line breaks.
1049
+ if (c0 === lbc.mandatoryBreak) {
1050
+ return true;
1051
+ }
1052
+
1053
+ // LB5 Treat CR followed by LF, as well as CR, LF, and NL as hard line breaks.
1054
+ if (c0 === lbc.carriageReturn) {
1055
+ if (c1 === lbc.lineFeed) {
1056
+ return false;
1057
+ }
1058
+ return true;
1059
+ }
1060
+ if (c0 === lbc.lineFeed || c0 === lbc.nextLine) {
1061
+ return true;
1062
+ }
1063
+
1064
+ // LB6 Do not break before hard line breaks.
1065
+ if (c1 === lbc.mandatoryBreak || c1 === lbc.carriageReturn || c1 === lbc.lineFeed || c1 === lbc.nextLine) {
1066
+ return false;
1067
+ }
1068
+
1069
+ // LB7 Do not break before spaces or zero width space.
1070
+ if (c1 === lbc.space){
1071
+ return false;
1072
+ }
1073
+ if (c1 === lbc.zeroWidthSpace){
1074
+ return false;
1075
+ }
1076
+
1077
+ // LB8 Break before any character following a zero-width space, even if one or more spaces intervene.
1078
+ if (c0 === lbc.zeroWidthSpace){
1079
+ if (c1 === lbc.space){
1080
+ return false;
1081
+ }
1082
+ return true;
1083
+ }
1084
+
1085
+ // LB8a Do not break after a zero width joiner.
1086
+ if (c0 === lbc.zeroWidthJoiner){
1087
+ return false;
1088
+ }
1089
+
1090
+ // LB9 Do not break a combining character sequence; treat it as if it has the line breaking class of the base character in all of the following rules. Treat ZWJ as if it were CM.
1091
+ while (c0 !== null && (c0 === lbc.combiningMark || c0 === lbc.zeroWidthJoiner)) {
1092
+ before.decrement();
1093
+ if (before._character !== null){
1094
+ c0 = before._character.lineBreakingClass;
1095
+ }else{
1096
+ c0 = null;
1097
+ }
1098
+ }
1099
+ if (c0 === null){
1100
+ return false;
1101
+ }
1102
+
1103
+ // LB10 Treat any remaining combining mark or ZWJ as AL.
1104
+ if (c1 === lbc.combiningMark || c1 === lbc.zeroWidthJoiner){
1105
+ c1 = lbc.alphabetic;
1106
+ }
1107
+
1108
+ // LB11 Do not break before or after Word joiner and related characters.
1109
+ if (c1 === lbc.wordJoiner){
1110
+ return false;
1111
+ }
1112
+ if (c0 === lbc.wordJoiner){
1113
+ return false;
1114
+ }
1115
+
1116
+ // LB12 Do not break after NBSP and related characters.
1117
+ if (c0 === lbc.glue){
1118
+ return false;
1119
+ }
1120
+
1121
+ // LB12a Do not break before NBSP and related characters, except after spaces and hyphens.
1122
+ if (c1 === lbc.glue){
1123
+ if (c0 === lbc.space || c0 === lbc.breakAfter || c0 === lbc.hyphen){
1124
+ return true;
1125
+ }
1126
+ return false;
1127
+ }
1128
+
1129
+ // LB13 Do not break before ‘]’ or ‘!’ or ‘;’ or ‘/’, even after spaces.
1130
+ if (c1 === lbc.closePunctuation){
1131
+ return false;
1132
+ }
1133
+ if (c1 === lbc.closingParenthesis){
1134
+ return false;
1135
+ }
1136
+ if (c1 === lbc.exclamation){
1137
+ return false;
1138
+ }
1139
+ if (c1 === lbc.infixNumeric){
1140
+ return false;
1141
+ }
1142
+ if (c1 === lbc.symbolsBreakAfter){
1143
+ return false;
1144
+ }
1145
+
1146
+ // LB14 Do not break after ‘[’, even after spaces.
1147
+ if (c0 === lbc.openPunctuation){
1148
+ return false;
1149
+ }
1150
+
1151
+ // LB15 Do not break within ‘”[’, even with intervening spaces.
1152
+ if (c0 === lbc.quotation && c1 === lbc.openPunctuation){
1153
+ return false;
1154
+ }
1155
+
1156
+ // LB16 Do not break between closing punctuation and a nonstarter (lb=NS), even with intervening spaces.
1157
+ if ((c0 === lbc.closePunctuation || c0 === lbc.closingParenthesis) && c1 === lbc.nonstarters){
1158
+ return false;
1159
+ }
1160
+
1161
+ // LB17 Do not break within ‘——’, even with intervening spaces.
1162
+ if (c0 === lbc.breakOpportunity && c1 === lbc.breakOpportunity){
1163
+ return false;
1164
+ }
1165
+
1166
+ // LB18 Break after spaces.
1167
+ if (c0 === lbc.space){
1168
+ // But first check for for intervening spaces in LB14-LB17
1169
+ while (c0 !== null && c0 === lbc.space){
1170
+ before.decrement();
1171
+ if (before._character !== null){
1172
+ c0 = before._character.lineBreakingClass;
1173
+ }else{
1174
+ c0 = null;
1175
+ }
1176
+ }
1177
+ // LB14
1178
+ if (c0 === lbc.openPunctuation){
1179
+ return false;
1180
+ }
1181
+ // LB15
1182
+ if (c0 === lbc.quotation && c1 === lbc.openPunctuation){
1183
+ return false;
1184
+ }
1185
+ // LB16
1186
+ if ((c0 === lbc.closePunctuation || c0 === lbc.closingParenthesis) && c1 === lbc.nonstarters){
1187
+ return false;
1188
+ }
1189
+ // LB17
1190
+ if (c0 === lbc.breakOpportunity && c1 === lbc.breakOpportunity){
1191
+ return false;
1192
+ }
1193
+ return true;
1194
+ }
1195
+
1196
+ // LB19 Do not break before or after quotation marks, such as ‘ ” ’.
1197
+ if (c0 === lbc.quotation || c1 === lbc.quotation){
1198
+ return false;
1199
+ }
1200
+
1201
+ // LB20 Break before and after unresolved CB.
1202
+ if (c0 === lbc.contingentBreak || c1 === lbc.contingentBreak){
1203
+ return false;
1204
+ }
1205
+
1206
+ // LB21 Do not break before hyphen-minus, other hyphens, fixed-width spaces, small kana, and other non-starters, or after acute accents.
1207
+ if (c1 === lbc.breakAfter){
1208
+ return false;
1209
+ }
1210
+ if (c1 === lbc.hyphen){
1211
+ return false;
1212
+ }
1213
+ if (c1 === lbc.nonstarters){
1214
+ return false;
1215
+ }
1216
+ if (c0 === lbc.breakBefore){
1217
+ return false;
1218
+ }
1219
+
1220
+ // LB21a Don't break after Hebrew + Hyphen.
1221
+ if (c0 === lbc.hyphen || c0 === lbc.breakAfter){
1222
+ before.decrement();
1223
+ if (before._character !== null && before._character.lineBreakingClass === lbc.hebrewLetter){
1224
+ return false;
1225
+ }
1226
+ before.increment();
1227
+ }
1228
+
1229
+ // LB22 Do not break before ellipses.
1230
+ if (c1 === lbc.inseperable){
1231
+ return false;
1232
+ }
1233
+
1234
+ // LB23 Do not break between digits and letters.
1235
+ if ((c0 === lbc.alphabetic || c0 === lbc.hebrewLetter) && c1 === lbc.numeric){
1236
+ return false;
1237
+ }
1238
+ if (c0 === lbc.numeric && (c1 === lbc.alphabetic || c1 === lbc.hebrewLetter)){
1239
+ return false;
1240
+ }
1241
+
1242
+ // LB23a Do not break between numeric prefixes and ideographs, or between ideographs and numeric postfixes.
1243
+ if (c0 === lbc.prefixNumeric && (c1 === lbc.ideographic || c1 === lbc.emojiBase || c1 === lbc.emojiModifier)){
1244
+ return false;
1245
+ }
1246
+ if ((c0 === lbc.ideographic || c0 === lbc.emojiBase || c0 === lbc.emojiModifier) && c1 === lbc.prefixNumeric){
1247
+ return false;
1248
+ }
1249
+
1250
+ // LB24 Do not break between numeric prefix/postfix and letters, or between letters and prefix/postfix.
1251
+ if ((c0 === lbc.prefixNumeric || c0 === lbc.postfixNumeric) && (c1 === lbc.alphabetic || c1 === lbc.hebrewLetter)){
1252
+ return false;
1253
+ }
1254
+ if ((c0 === lbc.alphabetic || c0 === lbc.hebrewLetter) && (c1 === lbc.prefixNumeric || c1 === lbc.postfixNumeric)){
1255
+ return false;
1256
+ }
1257
+
1258
+ // LB25 Do not break between the following pairs of classes relevant to numbers:
1259
+ if (c0 === lbc.closePunctuation && c1 === lbc.postfixNumeric){
1260
+ return false;
1261
+ }
1262
+ if (c0 === lbc.closingParenthesis && c1 === lbc.postfixNumeric){
1263
+ return false;
1264
+ }
1265
+ if (c0 === lbc.closePunctuation && c1 === lbc.prefixNumeric){
1266
+ return false;
1267
+ }
1268
+ if (c0 === lbc.closingParenthesis && c1 === lbc.prefixNumeric){
1269
+ return false;
1270
+ }
1271
+ if (c0 === lbc.numeric && c1 === lbc.postfixNumeric){
1272
+ return false;
1273
+ }
1274
+ if (c0 === lbc.numeric && c1 === lbc.prefixNumeric){
1275
+ return false;
1276
+ }
1277
+ if (c0 === lbc.postfixNumeric && c1 === lbc.openPunctuation){
1278
+ return false;
1279
+ }
1280
+ if (c0 === lbc.postfixNumeric && c1 === lbc.numeric){
1281
+ return false;
1282
+ }
1283
+ if (c0 === lbc.prefixNumeric && c1 === lbc.openPunctuation){
1284
+ return false;
1285
+ }
1286
+ if (c0 === lbc.prefixNumeric && c1 === lbc.numeric){
1287
+ return false;
1288
+ }
1289
+ if (c0 === lbc.hyphen && c1 === lbc.numeric){
1290
+ return false;
1291
+ }
1292
+ if (c0 === lbc.infixNumeric && c1 === lbc.numeric){
1293
+ return false;
1294
+ }
1295
+ if (c0 === lbc.numeric && c1 === lbc.numeric){
1296
+ return false;
1297
+ }
1298
+ if (c0 === lbc.symbolsBreakAfter && c1 === lbc.numeric){
1299
+ return false;
1300
+ }
1301
+
1302
+ // LB26 Do not break a Korean syllable.
1303
+ if (c0 === lbc.hangulLJambo){
1304
+ if (c1 === lbc.hangulLJambo){
1305
+ return false;
1306
+ }
1307
+ if (c1 === lbc.hangulVJambo){
1308
+ return false;
1309
+ }
1310
+ if (c1 === lbc.hangulVJambo){
1311
+ return false;
1312
+ }
1313
+ }
1314
+ if ((c0 === lbc.hangulVJambo || c0 === lbc.hangulLV) && (c1 === lbc.hangulVJambo || c1 === lbc.hangulTJambo)){
1315
+ return false;
1316
+ }
1317
+ if ((c0 === lbc.hangulTJambo || c0 === lbc.hangulLVT) && c1 === lbc.hangulTJambo){
1318
+ return false;
1319
+ }
1320
+
1321
+ // LB27 Treat a Korean Syllable Block the same as ID.
1322
+ if (c1 === lbc.postfixNumeric){
1323
+ if (c0 === lbc.hangulLJambo){
1324
+ return false;
1325
+ }
1326
+ if (c0 === lbc.hangulVJambo){
1327
+ return false;
1328
+ }
1329
+ if (c0 === lbc.hangulTJambo){
1330
+ return false;
1331
+ }
1332
+ if (c0 === lbc.hangulLV){
1333
+ return false;
1334
+ }
1335
+ if (c0 === lbc.hangulLVT){
1336
+ return false;
1337
+ }
1338
+ }
1339
+ if (c0 === lbc.prefixNumeric){
1340
+ if (c1 === lbc.hangulLJambo){
1341
+ return false;
1342
+ }
1343
+ if (c1 === lbc.hangulVJambo){
1344
+ return false;
1345
+ }
1346
+ if (c1 === lbc.hangulTJambo){
1347
+ return false;
1348
+ }
1349
+ if (c1 === lbc.hangulLV){
1350
+ return false;
1351
+ }
1352
+ if (c1 === lbc.hangulLVT){
1353
+ return false;
1354
+ }
1355
+ }
1356
+
1357
+ // LB28 Do not break between alphabetics (“at”).
1358
+ if ((c0 === lbc.alphabetic || c0 === lbc.hebrewLetter) && (c1 === lbc.alphabetic || c1 === lbc.hebrewLetter)){
1359
+ return false;
1360
+ }
1361
+
1362
+ // LB29 Do not break between numeric punctuation and alphabetics (“e.g.”).
1363
+ if (c0 === lbc.infixNumeric && (c1 === lbc.alphabetic || c1 === lbc.hebrewLetter)){
1364
+ return false;
1365
+ }
1366
+
1367
+ // LB30 Do not break between letters, numbers, or ordinary symbols and opening or closing parentheses.
1368
+ if ((c0 === lbc.alphabetic || c0 === lbc.hebrewLetter || c0 === lbc.numeric) && c1 === lbc.openPunctuation){
1369
+ return false;
1370
+ }
1371
+ if (c0 === lbc.openPunctuation && (c1 === lbc.alphabetic || c1 === lbc.hebrewLetter || c1 === lbc.numeric)){
1372
+ return false;
1373
+ }
1374
+
1375
+ // LB30a Break between two regional indicator symbols if and only if there are an even number of regional indicators preceding the position of the break.
1376
+
1377
+ // LB30b Do not break between an emoji base (or potential emoji) and an emoji modifier.
1378
+ if (c0 === lbc.emojiBase && c1 === lbc.emojiModifier){
1379
+ return false;
1380
+ }
1381
+
1382
+ // LB31 Break everywhere else.
1383
+ return true;
1384
+ }
1025
1385
  }
1026
1386
 
1027
1387
  });
@@ -1194,6 +1554,13 @@ Object.defineProperties(UserPerceivedCharacterIterator.prototype, {
1194
1554
  // can start with CR, we know the second character must be LF.
1195
1555
  return this._unicodeIterator.character.isParagraphBreak;
1196
1556
  }
1557
+ },
1558
+
1559
+ isLineBreakOpportunity: {
1560
+ enumerable: false,
1561
+ get: function UserPerceivedCharacterIterator_isLineBreakOpportunity(){
1562
+ return this._unicodeIterator.isLineBreakOpportunity;
1563
+ }
1197
1564
  }
1198
1565
 
1199
1566
  });