├── .github └── demo.png ├── .gitignore ├── .swift-format.json ├── Examples ├── Examples.xcodeproj │ ├── project.pbxproj │ └── project.xcworkspace │ │ ├── contents.xcworkspacedata │ │ └── xcshareddata │ │ └── IDEWorkspaceChecks.plist └── Examples │ ├── Assets.xcassets │ ├── AccentColor.colorset │ │ └── Contents.json │ ├── AppIcon.appiconset │ │ └── Contents.json │ └── Contents.json │ ├── ExampleView.swift │ ├── Examples.entitlements │ ├── ExamplesApp.swift │ └── Preview Content │ └── Preview Assets.xcassets │ └── Contents.json ├── LICENSE ├── Makefile ├── Package.swift ├── README.md └── Sources └── CodeMirror ├── CodeMirrorView.swift ├── CodeMirrorViewModel.swift ├── JavascriptFunction.swift ├── Languages.swift ├── ScriptMessageName.swift └── src ├── build ├── editor.bundle.js └── index.html ├── editor.js ├── package-lock.json ├── package.json └── rollup.config.js /.github/demo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/khoi/codemirror-swift/66e8008a01ef17f07087746f8afaffe35b8a3dc2/.github/demo.png -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | .DS_Store 2 | /.build 3 | /Packages 4 | /*.xcodeproj 5 | xcuserdata/ 6 | DerivedData/ 7 | .swiftpm/config/registries.json 8 | .swiftpm/xcode/package.xcworkspace/contents.xcworkspacedata 9 | .netrc 10 | Sources/CodeMirror/src/node_modules 11 | -------------------------------------------------------------------------------- /.swift-format.json: -------------------------------------------------------------------------------- 1 | { 2 | "fileScopedDeclarationPrivacy" : { 3 | "accessLevel" : "private" 4 | }, 5 | "indentation" : { 6 | "spaces" : 4 7 | }, 8 | "indentConditionalCompilationBlocks" : true, 9 | "indentSwitchCaseLabels" : false, 10 | "lineBreakAroundMultilineExpressionChainComponents" : true, 11 | "lineBreakBeforeControlFlowKeywords" : true, 12 | "lineBreakBeforeEachArgument" : true, 13 | "lineBreakBeforeEachGenericRequirement" : false, 14 | "lineLength" : 100, 15 | "maximumBlankLines" : 1, 16 | "prioritizeKeepingFunctionOutputTogether" : false, 17 | "respectsExistingLineBreaks" : true, 18 | "rules" : { 19 | "AllPublicDeclarationsHaveDocumentation" : false, 20 | "AlwaysUseLowerCamelCase" : true, 21 | "AmbiguousTrailingClosureOverload" : true, 22 | "BeginDocumentationCommentWithOneLineSummary" : true, 23 | "DoNotUseSemicolons" : true, 24 | "DontRepeatTypeInStaticProperties" : true, 25 | "FileScopedDeclarationPrivacy" : true, 26 | "FullyIndirectEnum" : true, 27 | "GroupNumericLiterals" : true, 28 | "IdentifiersMustBeASCII" : true, 29 | "NeverForceUnwrap" : false, 30 | "NeverUseForceTry" : false, 31 | "NeverUseImplicitlyUnwrappedOptionals" : false, 32 | "NoAccessLevelOnExtensionDeclaration" : true, 33 | "NoBlockComments" : true, 34 | "NoCasesWithOnlyFallthrough" : true, 35 | "NoEmptyTrailingClosureParentheses" : true, 36 | "NoLabelsInCasePatterns" : true, 37 | "NoLeadingUnderscores" : false, 38 | "NoParensAroundConditions" : true, 39 | "NoVoidReturnOnFunctionSignature" : true, 40 | "OneCasePerLine" : true, 41 | "OneVariableDeclarationPerLine" : true, 42 | "OnlyOneTrailingClosureArgument" : true, 43 | "OrderedImports" : true, 44 | "ReturnVoidInsteadOfEmptyTuple" : true, 45 | "UseEarlyExits" : true, 46 | "UseLetInEveryBoundCaseVariable" : true, 47 | "UseShorthandTypeNames" : true, 48 | "UseSingleLinePropertyGetter" : true, 49 | "UseSynthesizedInitializer" : true, 50 | "UseTripleSlashForDocumentationComments" : true, 51 | "UseWhereClausesInForLoops" : true, 52 | "ValidateDocumentationComments" : true 53 | }, 54 | "tabWidth" : 8, 55 | "version" : 1 56 | } 57 | -------------------------------------------------------------------------------- /Examples/Examples.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 56; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | D6655C2929F8FB3E00F3423A /* ExamplesApp.swift in Sources */ = {isa = PBXBuildFile; fileRef = D6655C2829F8FB3E00F3423A /* ExamplesApp.swift */; }; 11 | D6655C2D29F8FB3F00F3423A /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = D6655C2C29F8FB3F00F3423A /* Assets.xcassets */; }; 12 | D6655C3129F8FB3F00F3423A /* Preview Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = D6655C3029F8FB3F00F3423A /* Preview Assets.xcassets */; }; 13 | D6655C3A29F8FBFC00F3423A /* CodeMirror in Frameworks */ = {isa = PBXBuildFile; productRef = D6655C3929F8FBFC00F3423A /* CodeMirror */; }; 14 | D6CCCBA929F92FDC0065FFA1 /* ExampleView.swift in Sources */ = {isa = PBXBuildFile; fileRef = D6CCCBA829F92FDC0065FFA1 /* ExampleView.swift */; }; 15 | /* End PBXBuildFile section */ 16 | 17 | /* Begin PBXFileReference section */ 18 | D6655C2529F8FB3E00F3423A /* Examples.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Examples.app; sourceTree = BUILT_PRODUCTS_DIR; }; 19 | D6655C2829F8FB3E00F3423A /* ExamplesApp.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ExamplesApp.swift; sourceTree = ""; }; 20 | D6655C2C29F8FB3F00F3423A /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; 21 | D6655C2E29F8FB3F00F3423A /* Examples.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = Examples.entitlements; sourceTree = ""; }; 22 | D6655C3029F8FB3F00F3423A /* Preview Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = "Preview Assets.xcassets"; sourceTree = ""; }; 23 | D6655C3729F8FB6500F3423A /* codemirror-swift */ = {isa = PBXFileReference; lastKnownFileType = wrapper; name = "codemirror-swift"; path = ..; sourceTree = ""; }; 24 | D6CCCBA829F92FDC0065FFA1 /* ExampleView.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ExampleView.swift; sourceTree = ""; }; 25 | /* End PBXFileReference section */ 26 | 27 | /* Begin PBXFrameworksBuildPhase section */ 28 | D6655C2229F8FB3E00F3423A /* Frameworks */ = { 29 | isa = PBXFrameworksBuildPhase; 30 | buildActionMask = 2147483647; 31 | files = ( 32 | D6655C3A29F8FBFC00F3423A /* CodeMirror in Frameworks */, 33 | ); 34 | runOnlyForDeploymentPostprocessing = 0; 35 | }; 36 | /* End PBXFrameworksBuildPhase section */ 37 | 38 | /* Begin PBXGroup section */ 39 | D6655C1C29F8FB3E00F3423A = { 40 | isa = PBXGroup; 41 | children = ( 42 | D6655C3729F8FB6500F3423A /* codemirror-swift */, 43 | D6655C2729F8FB3E00F3423A /* Examples */, 44 | D6655C2629F8FB3E00F3423A /* Products */, 45 | D6655C3829F8FBFC00F3423A /* Frameworks */, 46 | ); 47 | sourceTree = ""; 48 | }; 49 | D6655C2629F8FB3E00F3423A /* Products */ = { 50 | isa = PBXGroup; 51 | children = ( 52 | D6655C2529F8FB3E00F3423A /* Examples.app */, 53 | ); 54 | name = Products; 55 | sourceTree = ""; 56 | }; 57 | D6655C2729F8FB3E00F3423A /* Examples */ = { 58 | isa = PBXGroup; 59 | children = ( 60 | D6CCCBA829F92FDC0065FFA1 /* ExampleView.swift */, 61 | D6655C2829F8FB3E00F3423A /* ExamplesApp.swift */, 62 | D6655C2C29F8FB3F00F3423A /* Assets.xcassets */, 63 | D6655C2E29F8FB3F00F3423A /* Examples.entitlements */, 64 | D6655C2F29F8FB3F00F3423A /* Preview Content */, 65 | ); 66 | path = Examples; 67 | sourceTree = ""; 68 | }; 69 | D6655C2F29F8FB3F00F3423A /* Preview Content */ = { 70 | isa = PBXGroup; 71 | children = ( 72 | D6655C3029F8FB3F00F3423A /* Preview Assets.xcassets */, 73 | ); 74 | path = "Preview Content"; 75 | sourceTree = ""; 76 | }; 77 | D6655C3829F8FBFC00F3423A /* Frameworks */ = { 78 | isa = PBXGroup; 79 | children = ( 80 | ); 81 | name = Frameworks; 82 | sourceTree = ""; 83 | }; 84 | /* End PBXGroup section */ 85 | 86 | /* Begin PBXNativeTarget section */ 87 | D6655C2429F8FB3E00F3423A /* Examples */ = { 88 | isa = PBXNativeTarget; 89 | buildConfigurationList = D6655C3429F8FB3F00F3423A /* Build configuration list for PBXNativeTarget "Examples" */; 90 | buildPhases = ( 91 | D6655C2129F8FB3E00F3423A /* Sources */, 92 | D6655C2229F8FB3E00F3423A /* Frameworks */, 93 | D6655C2329F8FB3E00F3423A /* Resources */, 94 | ); 95 | buildRules = ( 96 | ); 97 | dependencies = ( 98 | ); 99 | name = Examples; 100 | packageProductDependencies = ( 101 | D6655C3929F8FBFC00F3423A /* CodeMirror */, 102 | ); 103 | productName = Examples; 104 | productReference = D6655C2529F8FB3E00F3423A /* Examples.app */; 105 | productType = "com.apple.product-type.application"; 106 | }; 107 | /* End PBXNativeTarget section */ 108 | 109 | /* Begin PBXProject section */ 110 | D6655C1D29F8FB3E00F3423A /* Project object */ = { 111 | isa = PBXProject; 112 | attributes = { 113 | BuildIndependentTargetsInParallel = 1; 114 | LastSwiftUpdateCheck = 1420; 115 | LastUpgradeCheck = 1420; 116 | TargetAttributes = { 117 | D6655C2429F8FB3E00F3423A = { 118 | CreatedOnToolsVersion = 14.2; 119 | }; 120 | }; 121 | }; 122 | buildConfigurationList = D6655C2029F8FB3E00F3423A /* Build configuration list for PBXProject "Examples" */; 123 | compatibilityVersion = "Xcode 14.0"; 124 | developmentRegion = en; 125 | hasScannedForEncodings = 0; 126 | knownRegions = ( 127 | en, 128 | Base, 129 | ); 130 | mainGroup = D6655C1C29F8FB3E00F3423A; 131 | productRefGroup = D6655C2629F8FB3E00F3423A /* Products */; 132 | projectDirPath = ""; 133 | projectRoot = ""; 134 | targets = ( 135 | D6655C2429F8FB3E00F3423A /* Examples */, 136 | ); 137 | }; 138 | /* End PBXProject section */ 139 | 140 | /* Begin PBXResourcesBuildPhase section */ 141 | D6655C2329F8FB3E00F3423A /* Resources */ = { 142 | isa = PBXResourcesBuildPhase; 143 | buildActionMask = 2147483647; 144 | files = ( 145 | D6655C3129F8FB3F00F3423A /* Preview Assets.xcassets in Resources */, 146 | D6655C2D29F8FB3F00F3423A /* Assets.xcassets in Resources */, 147 | ); 148 | runOnlyForDeploymentPostprocessing = 0; 149 | }; 150 | /* End PBXResourcesBuildPhase section */ 151 | 152 | /* Begin PBXSourcesBuildPhase section */ 153 | D6655C2129F8FB3E00F3423A /* Sources */ = { 154 | isa = PBXSourcesBuildPhase; 155 | buildActionMask = 2147483647; 156 | files = ( 157 | D6655C2929F8FB3E00F3423A /* ExamplesApp.swift in Sources */, 158 | D6CCCBA929F92FDC0065FFA1 /* ExampleView.swift in Sources */, 159 | ); 160 | runOnlyForDeploymentPostprocessing = 0; 161 | }; 162 | /* End PBXSourcesBuildPhase section */ 163 | 164 | /* Begin XCBuildConfiguration section */ 165 | D6655C3229F8FB3F00F3423A /* Debug */ = { 166 | isa = XCBuildConfiguration; 167 | buildSettings = { 168 | ALWAYS_SEARCH_USER_PATHS = NO; 169 | CLANG_ANALYZER_NONNULL = YES; 170 | CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; 171 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++20"; 172 | CLANG_ENABLE_MODULES = YES; 173 | CLANG_ENABLE_OBJC_ARC = YES; 174 | CLANG_ENABLE_OBJC_WEAK = YES; 175 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 176 | CLANG_WARN_BOOL_CONVERSION = YES; 177 | CLANG_WARN_COMMA = YES; 178 | CLANG_WARN_CONSTANT_CONVERSION = YES; 179 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; 180 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 181 | CLANG_WARN_DOCUMENTATION_COMMENTS = YES; 182 | CLANG_WARN_EMPTY_BODY = YES; 183 | CLANG_WARN_ENUM_CONVERSION = YES; 184 | CLANG_WARN_INFINITE_RECURSION = YES; 185 | CLANG_WARN_INT_CONVERSION = YES; 186 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 187 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; 188 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 189 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 190 | CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES; 191 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 192 | CLANG_WARN_STRICT_PROTOTYPES = YES; 193 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 194 | CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; 195 | CLANG_WARN_UNREACHABLE_CODE = YES; 196 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 197 | COPY_PHASE_STRIP = NO; 198 | DEBUG_INFORMATION_FORMAT = dwarf; 199 | ENABLE_STRICT_OBJC_MSGSEND = YES; 200 | ENABLE_TESTABILITY = YES; 201 | GCC_C_LANGUAGE_STANDARD = gnu11; 202 | GCC_DYNAMIC_NO_PIC = NO; 203 | GCC_NO_COMMON_BLOCKS = YES; 204 | GCC_OPTIMIZATION_LEVEL = 0; 205 | GCC_PREPROCESSOR_DEFINITIONS = ( 206 | "DEBUG=1", 207 | "$(inherited)", 208 | ); 209 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 210 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 211 | GCC_WARN_UNDECLARED_SELECTOR = YES; 212 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 213 | GCC_WARN_UNUSED_FUNCTION = YES; 214 | GCC_WARN_UNUSED_VARIABLE = YES; 215 | MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE; 216 | MTL_FAST_MATH = YES; 217 | ONLY_ACTIVE_ARCH = YES; 218 | SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG; 219 | SWIFT_OPTIMIZATION_LEVEL = "-Onone"; 220 | }; 221 | name = Debug; 222 | }; 223 | D6655C3329F8FB3F00F3423A /* Release */ = { 224 | isa = XCBuildConfiguration; 225 | buildSettings = { 226 | ALWAYS_SEARCH_USER_PATHS = NO; 227 | CLANG_ANALYZER_NONNULL = YES; 228 | CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; 229 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++20"; 230 | CLANG_ENABLE_MODULES = YES; 231 | CLANG_ENABLE_OBJC_ARC = YES; 232 | CLANG_ENABLE_OBJC_WEAK = YES; 233 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 234 | CLANG_WARN_BOOL_CONVERSION = YES; 235 | CLANG_WARN_COMMA = YES; 236 | CLANG_WARN_CONSTANT_CONVERSION = YES; 237 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; 238 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 239 | CLANG_WARN_DOCUMENTATION_COMMENTS = YES; 240 | CLANG_WARN_EMPTY_BODY = YES; 241 | CLANG_WARN_ENUM_CONVERSION = YES; 242 | CLANG_WARN_INFINITE_RECURSION = YES; 243 | CLANG_WARN_INT_CONVERSION = YES; 244 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 245 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; 246 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 247 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 248 | CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES; 249 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 250 | CLANG_WARN_STRICT_PROTOTYPES = YES; 251 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 252 | CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; 253 | CLANG_WARN_UNREACHABLE_CODE = YES; 254 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 255 | COPY_PHASE_STRIP = NO; 256 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 257 | ENABLE_NS_ASSERTIONS = NO; 258 | ENABLE_STRICT_OBJC_MSGSEND = YES; 259 | GCC_C_LANGUAGE_STANDARD = gnu11; 260 | GCC_NO_COMMON_BLOCKS = YES; 261 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 262 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 263 | GCC_WARN_UNDECLARED_SELECTOR = YES; 264 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 265 | GCC_WARN_UNUSED_FUNCTION = YES; 266 | GCC_WARN_UNUSED_VARIABLE = YES; 267 | MTL_ENABLE_DEBUG_INFO = NO; 268 | MTL_FAST_MATH = YES; 269 | SWIFT_COMPILATION_MODE = wholemodule; 270 | SWIFT_OPTIMIZATION_LEVEL = "-O"; 271 | }; 272 | name = Release; 273 | }; 274 | D6655C3529F8FB3F00F3423A /* Debug */ = { 275 | isa = XCBuildConfiguration; 276 | buildSettings = { 277 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 278 | ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor; 279 | CODE_SIGN_ENTITLEMENTS = Examples/Examples.entitlements; 280 | CODE_SIGN_STYLE = Automatic; 281 | CURRENT_PROJECT_VERSION = 1; 282 | DEVELOPMENT_ASSET_PATHS = "\"Examples/Preview Content\""; 283 | DEVELOPMENT_TEAM = 9ZLSJ2GN2B; 284 | ENABLE_HARDENED_RUNTIME = YES; 285 | ENABLE_PREVIEWS = YES; 286 | GENERATE_INFOPLIST_FILE = YES; 287 | "INFOPLIST_KEY_UIApplicationSceneManifest_Generation[sdk=iphoneos*]" = YES; 288 | "INFOPLIST_KEY_UIApplicationSceneManifest_Generation[sdk=iphonesimulator*]" = YES; 289 | "INFOPLIST_KEY_UIApplicationSupportsIndirectInputEvents[sdk=iphoneos*]" = YES; 290 | "INFOPLIST_KEY_UIApplicationSupportsIndirectInputEvents[sdk=iphonesimulator*]" = YES; 291 | "INFOPLIST_KEY_UILaunchScreen_Generation[sdk=iphoneos*]" = YES; 292 | "INFOPLIST_KEY_UILaunchScreen_Generation[sdk=iphonesimulator*]" = YES; 293 | "INFOPLIST_KEY_UIStatusBarStyle[sdk=iphoneos*]" = UIStatusBarStyleDefault; 294 | "INFOPLIST_KEY_UIStatusBarStyle[sdk=iphonesimulator*]" = UIStatusBarStyleDefault; 295 | INFOPLIST_KEY_UISupportedInterfaceOrientations_iPad = "UIInterfaceOrientationPortrait UIInterfaceOrientationPortraitUpsideDown UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight"; 296 | INFOPLIST_KEY_UISupportedInterfaceOrientations_iPhone = "UIInterfaceOrientationPortrait UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight"; 297 | IPHONEOS_DEPLOYMENT_TARGET = 16.2; 298 | LD_RUNPATH_SEARCH_PATHS = "@executable_path/Frameworks"; 299 | "LD_RUNPATH_SEARCH_PATHS[sdk=macosx*]" = "@executable_path/../Frameworks"; 300 | MACOSX_DEPLOYMENT_TARGET = 13.1; 301 | MARKETING_VERSION = 1.0; 302 | PRODUCT_BUNDLE_IDENTIFIER = io.khoi.Examples; 303 | PRODUCT_NAME = "$(TARGET_NAME)"; 304 | SDKROOT = auto; 305 | SUPPORTED_PLATFORMS = "iphoneos iphonesimulator macosx"; 306 | SWIFT_EMIT_LOC_STRINGS = YES; 307 | SWIFT_VERSION = 5.0; 308 | TARGETED_DEVICE_FAMILY = "1,2"; 309 | }; 310 | name = Debug; 311 | }; 312 | D6655C3629F8FB3F00F3423A /* Release */ = { 313 | isa = XCBuildConfiguration; 314 | buildSettings = { 315 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 316 | ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor; 317 | CODE_SIGN_ENTITLEMENTS = Examples/Examples.entitlements; 318 | CODE_SIGN_STYLE = Automatic; 319 | CURRENT_PROJECT_VERSION = 1; 320 | DEVELOPMENT_ASSET_PATHS = "\"Examples/Preview Content\""; 321 | DEVELOPMENT_TEAM = 9ZLSJ2GN2B; 322 | ENABLE_HARDENED_RUNTIME = YES; 323 | ENABLE_PREVIEWS = YES; 324 | GENERATE_INFOPLIST_FILE = YES; 325 | "INFOPLIST_KEY_UIApplicationSceneManifest_Generation[sdk=iphoneos*]" = YES; 326 | "INFOPLIST_KEY_UIApplicationSceneManifest_Generation[sdk=iphonesimulator*]" = YES; 327 | "INFOPLIST_KEY_UIApplicationSupportsIndirectInputEvents[sdk=iphoneos*]" = YES; 328 | "INFOPLIST_KEY_UIApplicationSupportsIndirectInputEvents[sdk=iphonesimulator*]" = YES; 329 | "INFOPLIST_KEY_UILaunchScreen_Generation[sdk=iphoneos*]" = YES; 330 | "INFOPLIST_KEY_UILaunchScreen_Generation[sdk=iphonesimulator*]" = YES; 331 | "INFOPLIST_KEY_UIStatusBarStyle[sdk=iphoneos*]" = UIStatusBarStyleDefault; 332 | "INFOPLIST_KEY_UIStatusBarStyle[sdk=iphonesimulator*]" = UIStatusBarStyleDefault; 333 | INFOPLIST_KEY_UISupportedInterfaceOrientations_iPad = "UIInterfaceOrientationPortrait UIInterfaceOrientationPortraitUpsideDown UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight"; 334 | INFOPLIST_KEY_UISupportedInterfaceOrientations_iPhone = "UIInterfaceOrientationPortrait UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight"; 335 | IPHONEOS_DEPLOYMENT_TARGET = 16.2; 336 | LD_RUNPATH_SEARCH_PATHS = "@executable_path/Frameworks"; 337 | "LD_RUNPATH_SEARCH_PATHS[sdk=macosx*]" = "@executable_path/../Frameworks"; 338 | MACOSX_DEPLOYMENT_TARGET = 13.1; 339 | MARKETING_VERSION = 1.0; 340 | PRODUCT_BUNDLE_IDENTIFIER = io.khoi.Examples; 341 | PRODUCT_NAME = "$(TARGET_NAME)"; 342 | SDKROOT = auto; 343 | SUPPORTED_PLATFORMS = "iphoneos iphonesimulator macosx"; 344 | SWIFT_EMIT_LOC_STRINGS = YES; 345 | SWIFT_VERSION = 5.0; 346 | TARGETED_DEVICE_FAMILY = "1,2"; 347 | }; 348 | name = Release; 349 | }; 350 | /* End XCBuildConfiguration section */ 351 | 352 | /* Begin XCConfigurationList section */ 353 | D6655C2029F8FB3E00F3423A /* Build configuration list for PBXProject "Examples" */ = { 354 | isa = XCConfigurationList; 355 | buildConfigurations = ( 356 | D6655C3229F8FB3F00F3423A /* Debug */, 357 | D6655C3329F8FB3F00F3423A /* Release */, 358 | ); 359 | defaultConfigurationIsVisible = 0; 360 | defaultConfigurationName = Release; 361 | }; 362 | D6655C3429F8FB3F00F3423A /* Build configuration list for PBXNativeTarget "Examples" */ = { 363 | isa = XCConfigurationList; 364 | buildConfigurations = ( 365 | D6655C3529F8FB3F00F3423A /* Debug */, 366 | D6655C3629F8FB3F00F3423A /* Release */, 367 | ); 368 | defaultConfigurationIsVisible = 0; 369 | defaultConfigurationName = Release; 370 | }; 371 | /* End XCConfigurationList section */ 372 | 373 | /* Begin XCSwiftPackageProductDependency section */ 374 | D6655C3929F8FBFC00F3423A /* CodeMirror */ = { 375 | isa = XCSwiftPackageProductDependency; 376 | productName = CodeMirror; 377 | }; 378 | /* End XCSwiftPackageProductDependency section */ 379 | }; 380 | rootObject = D6655C1D29F8FB3E00F3423A /* Project object */; 381 | } 382 | -------------------------------------------------------------------------------- /Examples/Examples.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /Examples/Examples.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEDidComputeMac32BitWarning 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /Examples/Examples/Assets.xcassets/AccentColor.colorset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "colors" : [ 3 | { 4 | "idiom" : "universal" 5 | } 6 | ], 7 | "info" : { 8 | "author" : "xcode", 9 | "version" : 1 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /Examples/Examples/Assets.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "platform" : "ios", 6 | "size" : "1024x1024" 7 | }, 8 | { 9 | "idiom" : "mac", 10 | "scale" : "1x", 11 | "size" : "16x16" 12 | }, 13 | { 14 | "idiom" : "mac", 15 | "scale" : "2x", 16 | "size" : "16x16" 17 | }, 18 | { 19 | "idiom" : "mac", 20 | "scale" : "1x", 21 | "size" : "32x32" 22 | }, 23 | { 24 | "idiom" : "mac", 25 | "scale" : "2x", 26 | "size" : "32x32" 27 | }, 28 | { 29 | "idiom" : "mac", 30 | "scale" : "1x", 31 | "size" : "128x128" 32 | }, 33 | { 34 | "idiom" : "mac", 35 | "scale" : "2x", 36 | "size" : "128x128" 37 | }, 38 | { 39 | "idiom" : "mac", 40 | "scale" : "1x", 41 | "size" : "256x256" 42 | }, 43 | { 44 | "idiom" : "mac", 45 | "scale" : "2x", 46 | "size" : "256x256" 47 | }, 48 | { 49 | "idiom" : "mac", 50 | "scale" : "1x", 51 | "size" : "512x512" 52 | }, 53 | { 54 | "idiom" : "mac", 55 | "scale" : "2x", 56 | "size" : "512x512" 57 | } 58 | ], 59 | "info" : { 60 | "author" : "xcode", 61 | "version" : 1 62 | } 63 | } 64 | -------------------------------------------------------------------------------- /Examples/Examples/Assets.xcassets/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "info" : { 3 | "author" : "xcode", 4 | "version" : 1 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /Examples/Examples/ExampleView.swift: -------------------------------------------------------------------------------- 1 | import CodeMirror 2 | import SwiftUI 3 | 4 | struct ExampleView: View { 5 | @ObservedObject private var viewModel = CodeMirrorViewModel( 6 | onLoadSuccess: { 7 | print("@@@ \(#function)") 8 | }, 9 | onLoadFailed: { error in 10 | print("@@@ \(#function) \(error)") 11 | }, 12 | onContentChange: { 13 | // print("@@@ Content Did Change") 14 | } 15 | ) 16 | 17 | var body: some View { 18 | CodeMirrorView( 19 | viewModel 20 | ) 21 | .frame(maxWidth: .infinity, maxHeight: .infinity) 22 | 23 | .toolbar { 24 | ToolbarItem { 25 | Toggle(isOn: $viewModel.darkMode, label: { Text("🌖") }) 26 | .toggleStyle(.checkbox) 27 | } 28 | 29 | ToolbarItem { 30 | Toggle(isOn: $viewModel.lineWrapping, label: { Text("Line Wrapping") }) 31 | .toggleStyle(.checkbox) 32 | } 33 | 34 | ToolbarItem { 35 | Button { 36 | viewModel.setContent("YOLO") 37 | } label: { 38 | Text("SET") 39 | } 40 | 41 | } 42 | 43 | ToolbarItem { 44 | Button { 45 | Task { 46 | let content = try? await viewModel.getContent() 47 | print(content ?? "") 48 | } 49 | } label: { 50 | Text("GET") 51 | } 52 | } 53 | ToolbarItem { 54 | Toggle(isOn: $viewModel.readOnly, label: { Text("READONLY") }) 55 | .toggleStyle(.checkbox) 56 | 57 | } 58 | ToolbarItem { 59 | Picker("Lang", selection: $viewModel.language) { 60 | ForEach(Language.allCases, id: \.rawValue) { 61 | Text($0.rawValue).tag($0) 62 | } 63 | } 64 | } 65 | } 66 | .onAppear { 67 | viewModel.setContent(jsonString) 68 | } 69 | .navigationTitle("Example") 70 | } 71 | } 72 | 73 | struct ContentView_Previews: PreviewProvider { 74 | static var previews: some View { 75 | ExampleView() 76 | } 77 | } 78 | 79 | private let jsonString = """ 80 | { 81 | "header": { 82 | "alg": "EdDSA", 83 | "kid": "2023-02-22", 84 | "typ": "JWT" 85 | }, 86 | "payload": { 87 | "aud": [ 88 | "plan" 89 | ], 90 | "exp": 1682484288, 91 | "iat": 1682480688, 92 | "iss": "https://accounts.toggl.space", 93 | "jti": "3810df07c7cb738fcab6caad9e3f78ba", 94 | "nbf": 1682480688, 95 | "sub": "QpTmkjFk6acasstoN50vp0wf0xL2" 96 | }, 97 | "signature": "EIPCgh2O7IO1HmWfSHtKgSqsFPgPlRiYfiUrwyenEf5AV4rtZc1Na1Vi0T6smCYj7SR0vmz1VO35B6HVsMnKBw" 98 | } 99 | """ 100 | -------------------------------------------------------------------------------- /Examples/Examples/Examples.entitlements: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /Examples/Examples/ExamplesApp.swift: -------------------------------------------------------------------------------- 1 | import SwiftUI 2 | 3 | @main 4 | struct ExamplesApp: App { 5 | var body: some Scene { 6 | WindowGroup { 7 | ExampleView() 8 | } 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /Examples/Examples/Preview Content/Preview Assets.xcassets/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "info" : { 3 | "author" : "xcode", 4 | "version" : 1 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2020 khoi 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /Makefile: -------------------------------------------------------------------------------- 1 | default: build 2 | 3 | build-codemirror: 4 | cd ./Sources/CodeMirror/src && npm install && ./node_modules/.bin/rollup -c 5 | 6 | open-codemirror: 7 | open ./Sources/CodeMirror/src/build/index.html 8 | 9 | build-swift: 10 | swift build -v 11 | 12 | clean: 13 | swift package clean 14 | 15 | build: build-codemirror build-swift 16 | 17 | format: 18 | swift-format --in-place --recursive --configuration ./.swift-format.json ./ 19 | 20 | .PHONY: clean test format build-codemirror open-codemirror -------------------------------------------------------------------------------- /Package.swift: -------------------------------------------------------------------------------- 1 | // swift-tools-version: 5.6 2 | 3 | import PackageDescription 4 | 5 | let package = Package( 6 | name: "CodeMirror", 7 | platforms: [ 8 | .macOS(.v11), 9 | .iOS(.v14), 10 | ], 11 | products: [ 12 | 13 | .library( 14 | name: "CodeMirror", 15 | targets: ["CodeMirror"] 16 | ) 17 | ], 18 | dependencies: [], 19 | targets: [ 20 | .target( 21 | name: "CodeMirror", 22 | dependencies: [], 23 | exclude: [ 24 | "src/node_modules", 25 | "src/editor.js", 26 | "src/rollup.config.js", 27 | "src/package.json", 28 | "src/package-lock.json", 29 | ], 30 | resources: [ 31 | .copy("src/build") 32 | ] 33 | ) 34 | ] 35 | ) 36 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 |

2 | 3 | ## ✨ Features 4 | 5 | - ⚡️ Minimal and fast 6 | - 🐘 Can deal with huge document 7 | - 🧛‍♂️ Dark/light theme 8 | - 📱 Supports macOS and iOS 9 | - 🧑‍🎨 SwiftUI 10 | 11 | ## 📦 SPM 12 | 13 | Add `https://github.com/khoi/codemirror-swift.git` to your dependencies. 14 | 15 | ## 🚧 Modifications 16 | 17 | - Make changes to [./Sources/CodeMirror/src/editor.js](./Sources/CodeMirror/src/editor.js) 18 | - Run `make build-codemirror` 19 | 20 | ## 🙇‍♂️ Credit 21 | 22 | - https://codemirror.net 23 | - https://github.com/ProxymanApp/CodeMirror-Swift 24 | -------------------------------------------------------------------------------- /Sources/CodeMirror/CodeMirrorView.swift: -------------------------------------------------------------------------------- 1 | import SwiftUI 2 | import WebKit 3 | 4 | #if canImport(AppKit) 5 | public typealias NativeView = NSViewRepresentable 6 | #elseif canImport(UIKit) 7 | public typealias NativeView = UIViewRepresentable 8 | #endif 9 | 10 | @MainActor 11 | public struct CodeMirrorView: NativeView { 12 | @ObservedObject public var viewModel: CodeMirrorViewModel 13 | 14 | public init(_ viewModel: CodeMirrorViewModel) { 15 | self.viewModel = viewModel 16 | } 17 | 18 | #if canImport(AppKit) 19 | public func makeNSView(context: Context) -> WKWebView { 20 | createWebView(context: context) 21 | } 22 | 23 | public func updateNSView(_ nsView: WKWebView, context: Context) { 24 | updateWebView(context: context) 25 | } 26 | #elseif canImport(UIKit) 27 | public func makeUIView(context: Context) -> WKWebView { 28 | createWebView(context: context) 29 | } 30 | 31 | public func updateUIView(_ nsView: WKWebView, context: Context) { 32 | updateWebView(context: context) 33 | } 34 | #endif 35 | 36 | private func createWebView(context: Context) -> WKWebView { 37 | let preferences = WKPreferences() 38 | let userController = WKUserContentController() 39 | userController.add(context.coordinator, name: ScriptMessageName.codeMirrorDidReady) 40 | userController.add(context.coordinator, name: ScriptMessageName.codeMirrorContentDidChange) 41 | 42 | let configuration = WKWebViewConfiguration() 43 | configuration.preferences = preferences 44 | configuration.userContentController = userController 45 | 46 | let webView = WKWebView(frame: .zero, configuration: configuration) 47 | webView.navigationDelegate = context.coordinator 48 | #if os(OSX) 49 | webView.setValue(false, forKey: "drawsBackground") // prevent white flicks 50 | webView.allowsMagnification = false 51 | #elseif os(iOS) 52 | webView.isOpaque = false 53 | #endif 54 | 55 | let indexURL = Bundle.module.url( 56 | forResource: "index", 57 | withExtension: "html", 58 | subdirectory: "build" 59 | ) 60 | 61 | let baseURL = Bundle.module.url(forResource: "build", withExtension: nil) 62 | let data = try! Data.init(contentsOf: indexURL!) 63 | webView.load(data, mimeType: "text/html", characterEncodingName: "utf-8", baseURL: baseURL!) 64 | context.coordinator.webView = webView 65 | return webView 66 | } 67 | 68 | private func updateWebView(context: Context) { 69 | context.coordinator.queueJavascriptFunction( 70 | JavascriptFunction( 71 | functionString: "CodeMirror.setDarkMode(value)", 72 | args: ["value": viewModel.darkMode] 73 | ) 74 | ) 75 | context.coordinator.queueJavascriptFunction( 76 | JavascriptFunction( 77 | functionString: "CodeMirror.setLineWrapping(value)", 78 | args: ["value": viewModel.lineWrapping] 79 | ) 80 | ) 81 | context.coordinator.queueJavascriptFunction( 82 | JavascriptFunction( 83 | functionString: "CodeMirror.setReadOnly(value)", 84 | args: ["value": viewModel.readOnly] 85 | ) 86 | ) 87 | context.coordinator.queueJavascriptFunction( 88 | JavascriptFunction( 89 | functionString: "CodeMirror.setLanguage(value)", 90 | args: ["value": viewModel.language.rawValue] 91 | ) 92 | ) 93 | } 94 | 95 | public func makeCoordinator() -> Coordinator { 96 | let coordinator = Coordinator(parent: self, viewModel: viewModel) 97 | 98 | viewModel.executeJS = { fn, cb in 99 | coordinator.queueJavascriptFunction(fn, callback: cb) 100 | } 101 | return coordinator 102 | } 103 | } 104 | 105 | @MainActor 106 | public class Coordinator: NSObject { 107 | var parent: CodeMirrorView 108 | var viewModel: CodeMirrorViewModel 109 | var webView: WKWebView! 110 | 111 | private var pageLoaded = false 112 | private var pendingFunctions = [(JavascriptFunction, JavascriptCallback?)]() 113 | 114 | init(parent: CodeMirrorView, viewModel: CodeMirrorViewModel) { 115 | self.parent = parent 116 | self.viewModel = viewModel 117 | } 118 | 119 | internal func queueJavascriptFunction( 120 | _ function: JavascriptFunction, 121 | callback: JavascriptCallback? = nil 122 | ) { 123 | if pageLoaded { 124 | evaluateJavascript(function: function, callback: callback) 125 | } 126 | else { 127 | pendingFunctions.append((function, callback)) 128 | } 129 | } 130 | 131 | private func callPendingFunctions() { 132 | for (function, callback) in pendingFunctions { 133 | evaluateJavascript(function: function, callback: callback) 134 | } 135 | pendingFunctions.removeAll() 136 | } 137 | 138 | private func evaluateJavascript( 139 | function: JavascriptFunction, 140 | callback: JavascriptCallback? = nil 141 | ) { 142 | // not sure why but callAsyncJavaScript always callback with result of nil 143 | if let callback = callback { 144 | webView.evaluateJavaScript(function.functionString) { (response, error) in 145 | if let error = error { 146 | callback(.failure(error)) 147 | } 148 | else { 149 | callback(.success(response)) 150 | } 151 | } 152 | } 153 | else { 154 | webView.callAsyncJavaScript( 155 | function.functionString, 156 | arguments: function.args, 157 | in: nil, 158 | in: .page 159 | ) { (result) in 160 | switch result { 161 | case .failure(let error): 162 | callback?(.failure(error)) 163 | case .success(let data): 164 | callback?(.success(data)) 165 | } 166 | } 167 | } 168 | } 169 | } 170 | 171 | extension Coordinator: WKScriptMessageHandler { 172 | public func userContentController( 173 | _ userContentController: WKUserContentController, 174 | didReceive message: WKScriptMessage 175 | ) { 176 | switch message.name { 177 | case ScriptMessageName.codeMirrorDidReady: 178 | pageLoaded = true 179 | callPendingFunctions() 180 | case ScriptMessageName.codeMirrorContentDidChange: 181 | parent.viewModel.onContentChange?() 182 | default: 183 | print("CodeMirrorWebView receive \(message.name) \(message.body)") 184 | } 185 | } 186 | } 187 | 188 | extension Coordinator: WKNavigationDelegate { 189 | public func webView(_ webView: WKWebView, didFinish navigation: WKNavigation!) { 190 | parent.viewModel.onLoadSuccess?() 191 | } 192 | 193 | public func webView( 194 | _ webView: WKWebView, 195 | didFail navigation: WKNavigation!, 196 | withError error: Error 197 | ) { 198 | parent.viewModel.onLoadFailed?(error) 199 | } 200 | 201 | public func webView( 202 | _ webView: WKWebView, 203 | didFailProvisionalNavigation navigation: WKNavigation!, 204 | withError error: Error 205 | ) { 206 | parent.viewModel.onLoadFailed?(error) 207 | } 208 | } 209 | -------------------------------------------------------------------------------- /Sources/CodeMirror/CodeMirrorViewModel.swift: -------------------------------------------------------------------------------- 1 | import SwiftUI 2 | 3 | @MainActor 4 | public class CodeMirrorViewModel: ObservableObject { 5 | public var onLoadSuccess: (() -> Void)? 6 | public var onLoadFailed: ((Error) -> Void)? 7 | public var onContentChange: (() -> Void)? 8 | 9 | internal var executeJS: ((JavascriptFunction, JavascriptCallback?) -> Void)! 10 | 11 | @Published public var darkMode = false 12 | @Published public var lineWrapping = false 13 | @Published public var readOnly = false 14 | @Published public var language: Language = .json 15 | 16 | private func executeJSAsync(f: JavascriptFunction) async throws -> T? { 17 | return try await withCheckedThrowingContinuation { continuation in 18 | executeJS(f) { result in 19 | continuation.resume(with: result.map { $0 as? T }) 20 | } 21 | } 22 | } 23 | 24 | public func getContent() async throws -> String? { 25 | try await executeJSAsync( 26 | f: JavascriptFunction( 27 | functionString: "CodeMirror.getContent()" 28 | ) 29 | ) 30 | } 31 | 32 | public func setContent(_ value: String) { 33 | executeJS( 34 | JavascriptFunction( 35 | functionString: "CodeMirror.setContent(value)", 36 | args: ["value": value] 37 | ), 38 | nil 39 | ) 40 | } 41 | 42 | public init( 43 | onLoadSuccess: (() -> Void)? = nil, 44 | onLoadFailed: ((Error) -> Void)? = nil, 45 | onContentChange: (() -> Void)? = nil 46 | ) { 47 | self.onLoadSuccess = onLoadSuccess 48 | self.onLoadFailed = onLoadFailed 49 | self.onContentChange = onContentChange 50 | } 51 | } 52 | -------------------------------------------------------------------------------- /Sources/CodeMirror/JavascriptFunction.swift: -------------------------------------------------------------------------------- 1 | public typealias JavascriptCallback = (Result) -> Void 2 | 3 | public struct JavascriptFunction { 4 | 5 | public let functionString: String 6 | public let args: [String: Any] 7 | 8 | public init( 9 | functionString: String, 10 | args: [String: Any] = [:] 11 | ) { 12 | self.functionString = functionString 13 | self.args = args 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /Sources/CodeMirror/Languages.swift: -------------------------------------------------------------------------------- 1 | public enum Language: String, CaseIterable, Hashable { 2 | case javascript 3 | case json 4 | case html 5 | case css 6 | case xml 7 | case txt 8 | } 9 | -------------------------------------------------------------------------------- /Sources/CodeMirror/ScriptMessageName.swift: -------------------------------------------------------------------------------- 1 | import Foundation 2 | 3 | public enum ScriptMessageName { 4 | public static let codeMirrorDidReady = "codeMirrorDidReady" 5 | public static let codeMirrorContentDidChange = "codeMirrorContentDidChange" 6 | } 7 | -------------------------------------------------------------------------------- /Sources/CodeMirror/src/build/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 23 | 24 | 25 | 26 | 27 | 38 | 39 | 40 | -------------------------------------------------------------------------------- /Sources/CodeMirror/src/editor.js: -------------------------------------------------------------------------------- 1 | import * as CodeMirror from "codemirror"; 2 | import { javascript } from "@codemirror/lang-javascript"; 3 | import { Compartment, EditorState } from "@codemirror/state"; 4 | import { EditorView } from "@codemirror/view"; 5 | import { indentWithTab } from "@codemirror/commands"; 6 | import { html } from "@codemirror/lang-html"; 7 | import { json } from "@codemirror/lang-json"; 8 | import { xml } from "@codemirror/lang-xml"; 9 | import { css } from "@codemirror/lang-css"; 10 | import { oneDark } from "@codemirror/theme-one-dark"; 11 | 12 | import { 13 | lineNumbers, 14 | highlightActiveLineGutter, 15 | highlightSpecialChars, 16 | drawSelection, 17 | dropCursor, 18 | rectangularSelection, 19 | crosshairCursor, 20 | highlightActiveLine, 21 | keymap, 22 | } from "@codemirror/view"; 23 | 24 | import { 25 | foldGutter, 26 | indentOnInput, 27 | syntaxHighlighting, 28 | defaultHighlightStyle, 29 | bracketMatching, 30 | foldKeymap, 31 | } from "@codemirror/language"; 32 | 33 | import { history, defaultKeymap, historyKeymap } from "@codemirror/commands"; 34 | import { highlightSelectionMatches, searchKeymap } from "@codemirror/search"; 35 | import { 36 | closeBrackets, 37 | autocompletion, 38 | closeBracketsKeymap, 39 | completionKeymap, 40 | } from "@codemirror/autocomplete"; 41 | 42 | const theme = new Compartment(); 43 | const language = new Compartment(); 44 | const listener = new Compartment(); 45 | const readOnly = new Compartment(); 46 | const lineWrapping = new Compartment(); 47 | const SUPPORTED_LANGUAGES_MAP = { 48 | javascript, 49 | json, 50 | html, 51 | css, 52 | xml, 53 | txt: () => [], 54 | }; 55 | 56 | const baseTheme = EditorView.baseTheme({ 57 | "&light": { 58 | backgroundColor: "white", // the default codemirror light theme doesn't set this up 59 | "color-scheme": "light", 60 | }, 61 | "&dark": { 62 | "color-scheme": "dark", 63 | }, 64 | }); 65 | 66 | const editorView = new CodeMirror.EditorView({ 67 | doc: "", 68 | extensions: [ 69 | lineNumbers(), 70 | highlightActiveLineGutter(), 71 | highlightSpecialChars(), 72 | history(), 73 | foldGutter(), 74 | drawSelection(), 75 | dropCursor(), 76 | indentOnInput(), 77 | syntaxHighlighting(defaultHighlightStyle, { fallback: true }), 78 | bracketMatching(), 79 | closeBrackets(), 80 | autocompletion(), 81 | rectangularSelection(), 82 | crosshairCursor(), 83 | highlightActiveLine(), 84 | highlightSelectionMatches(), 85 | keymap.of([ 86 | ...closeBracketsKeymap, 87 | ...defaultKeymap, 88 | ...searchKeymap, 89 | ...historyKeymap, 90 | ...foldKeymap, 91 | ...completionKeymap, 92 | indentWithTab, 93 | ]), 94 | readOnly.of([]), 95 | lineWrapping.of([]), 96 | baseTheme, 97 | theme.of(oneDark), 98 | language.of(json()), 99 | listener.of([]), 100 | ], 101 | parent: document.body, 102 | }); 103 | 104 | function getSupportedLanguages() { 105 | return Object.keys(SUPPORTED_LANGUAGES_MAP); 106 | } 107 | 108 | function setDarkMode(active) { 109 | editorView.dispatch({ 110 | effects: theme.reconfigure(active ? [oneDark] : []), 111 | }); 112 | } 113 | 114 | function setLanguage(lang) { 115 | let langFn = SUPPORTED_LANGUAGES_MAP[lang]; 116 | editorView.dispatch({ 117 | effects: language.reconfigure(langFn ? langFn() : []), 118 | }); 119 | } 120 | 121 | function setContent(text) { 122 | editorView.dispatch({ 123 | changes: { from: 0, to: editorView.state.doc.length, insert: text }, 124 | }); 125 | } 126 | 127 | function getContent() { 128 | return editorView.state.doc.toString(); 129 | } 130 | 131 | function setListener(fn) { 132 | editorView.dispatch({ 133 | effects: listener.reconfigure( 134 | EditorView.updateListener.of((v) => { 135 | if (v.docChanged) { 136 | fn(); 137 | } 138 | }) 139 | ), 140 | }); 141 | } 142 | 143 | function setReadOnly(value) { 144 | editorView.dispatch({ 145 | effects: readOnly.reconfigure(value ? EditorState.readOnly.of(true) : []), 146 | }); 147 | } 148 | 149 | function setLineWrapping(enabled) { 150 | editorView.dispatch({ 151 | effects: lineWrapping.reconfigure(enabled ? EditorView.lineWrapping : []), 152 | }); 153 | } 154 | 155 | export { 156 | setDarkMode, 157 | setLanguage, 158 | getSupportedLanguages, 159 | setContent, 160 | getContent, 161 | setListener, 162 | setReadOnly, 163 | setLineWrapping, 164 | editorView, 165 | }; 166 | -------------------------------------------------------------------------------- /Sources/CodeMirror/src/package-lock.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "src", 3 | "lockfileVersion": 3, 4 | "requires": true, 5 | "packages": { 6 | "": { 7 | "dependencies": { 8 | "@codemirror/lang-css": "^6.0.0", 9 | "@codemirror/lang-html": "^6.0.0", 10 | "@codemirror/lang-javascript": "^6.0.0", 11 | "@codemirror/lang-json": "^6.0.0", 12 | "@codemirror/lang-xml": "^6.0.0", 13 | "@codemirror/language-data": "^6.0.0", 14 | "@codemirror/theme-one-dark": "^6.0.0", 15 | "@rollup/plugin-node-resolve": "^13.3.0", 16 | "codemirror": "^6.0.0", 17 | "rollup": "^2.75.6", 18 | "rollup-plugin-terser": "^7.0.2" 19 | } 20 | }, 21 | "node_modules/@babel/code-frame": { 22 | "version": "7.21.4", 23 | "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.21.4.tgz", 24 | "integrity": "sha512-LYvhNKfwWSPpocw8GI7gpK2nq3HSDuEPC/uSYaALSJu9xjsalaaYFOq0Pwt5KmVqwEbZlDu81aLXwBOmD/Fv9g==", 25 | "dependencies": { 26 | "@babel/highlight": "^7.18.6" 27 | }, 28 | "engines": { 29 | "node": ">=6.9.0" 30 | } 31 | }, 32 | "node_modules/@babel/helper-validator-identifier": { 33 | "version": "7.19.1", 34 | "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.19.1.tgz", 35 | "integrity": "sha512-awrNfaMtnHUr653GgGEs++LlAvW6w+DcPrOliSMXWCKo597CwL5Acf/wWdNkf/tfEQE3mjkeD1YOVZOUV/od1w==", 36 | "engines": { 37 | "node": ">=6.9.0" 38 | } 39 | }, 40 | "node_modules/@babel/highlight": { 41 | "version": "7.18.6", 42 | "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.18.6.tgz", 43 | "integrity": "sha512-u7stbOuYjaPezCuLj29hNW1v64M2Md2qupEKP1fHc7WdOA3DgLh37suiSrZYY7haUB7iBeQZ9P1uiRF359do3g==", 44 | "dependencies": { 45 | "@babel/helper-validator-identifier": "^7.18.6", 46 | "chalk": "^2.0.0", 47 | "js-tokens": "^4.0.0" 48 | }, 49 | "engines": { 50 | "node": ">=6.9.0" 51 | } 52 | }, 53 | "node_modules/@codemirror/autocomplete": { 54 | "version": "6.5.1", 55 | "resolved": "https://registry.npmjs.org/@codemirror/autocomplete/-/autocomplete-6.5.1.tgz", 56 | "integrity": "sha512-/Sv9yJmqyILbZ26U4LBHnAtbikuVxWUp+rQ8BXuRGtxZfbfKOY/WPbsUtvSP2h0ZUZMlkxV/hqbKRFzowlA6xw==", 57 | "dependencies": { 58 | "@codemirror/language": "^6.0.0", 59 | "@codemirror/state": "^6.0.0", 60 | "@codemirror/view": "^6.6.0", 61 | "@lezer/common": "^1.0.0" 62 | }, 63 | "peerDependencies": { 64 | "@codemirror/language": "^6.0.0", 65 | "@codemirror/state": "^6.0.0", 66 | "@codemirror/view": "^6.0.0", 67 | "@lezer/common": "^1.0.0" 68 | } 69 | }, 70 | "node_modules/@codemirror/commands": { 71 | "version": "6.2.3", 72 | "resolved": "https://registry.npmjs.org/@codemirror/commands/-/commands-6.2.3.tgz", 73 | "integrity": "sha512-9uf0g9m2wZyrIim1SavcxMdwsu8wc/y5uSw6JRUBYIGWrN+RY4vSru/BqB+MyNWqx4C2uRhQ/Kh7Pw8lAyT3qQ==", 74 | "dependencies": { 75 | "@codemirror/language": "^6.0.0", 76 | "@codemirror/state": "^6.2.0", 77 | "@codemirror/view": "^6.0.0", 78 | "@lezer/common": "^1.0.0" 79 | } 80 | }, 81 | "node_modules/@codemirror/lang-angular": { 82 | "version": "0.1.0", 83 | "resolved": "https://registry.npmjs.org/@codemirror/lang-angular/-/lang-angular-0.1.0.tgz", 84 | "integrity": "sha512-vTjoHjzJmLrrMFmf/tojwp+O0P+R9mgWtjjaKDNDoY58PzOPg7ldMEBqIzABBc+/2mYPD85SG7O5byfBxc83eA==", 85 | "dependencies": { 86 | "@codemirror/lang-html": "^6.0.0", 87 | "@codemirror/lang-javascript": "^6.1.2", 88 | "@codemirror/language": "^6.0.0", 89 | "@lezer/common": "^1.0.0", 90 | "@lezer/highlight": "^1.0.0" 91 | } 92 | }, 93 | "node_modules/@codemirror/lang-cpp": { 94 | "version": "6.0.2", 95 | "resolved": "https://registry.npmjs.org/@codemirror/lang-cpp/-/lang-cpp-6.0.2.tgz", 96 | "integrity": "sha512-6oYEYUKHvrnacXxWxYa6t4puTlbN3dgV662BDfSH8+MfjQjVmP697/KYTDOqpxgerkvoNm7q5wlFMBeX8ZMocg==", 97 | "dependencies": { 98 | "@codemirror/language": "^6.0.0", 99 | "@lezer/cpp": "^1.0.0" 100 | } 101 | }, 102 | "node_modules/@codemirror/lang-css": { 103 | "version": "6.1.1", 104 | "resolved": "https://registry.npmjs.org/@codemirror/lang-css/-/lang-css-6.1.1.tgz", 105 | "integrity": "sha512-P6jdNEHyRcqqDgbvHYyC9Wxkek0rnG3a9aVSRi4a7WrjPbQtBTaOmvYpXmm13zZMAatO4Oqpac+0QZs7sy+LnQ==", 106 | "dependencies": { 107 | "@codemirror/autocomplete": "^6.0.0", 108 | "@codemirror/language": "^6.0.0", 109 | "@codemirror/state": "^6.0.0", 110 | "@lezer/css": "^1.0.0" 111 | } 112 | }, 113 | "node_modules/@codemirror/lang-html": { 114 | "version": "6.4.3", 115 | "resolved": "https://registry.npmjs.org/@codemirror/lang-html/-/lang-html-6.4.3.tgz", 116 | "integrity": "sha512-VKzQXEC8nL69Jg2hvAFPBwOdZNvL8tMFOrdFwWpU+wc6a6KEkndJ/19R5xSaglNX6v2bttm8uIEFYxdQDcIZVQ==", 117 | "dependencies": { 118 | "@codemirror/autocomplete": "^6.0.0", 119 | "@codemirror/lang-css": "^6.0.0", 120 | "@codemirror/lang-javascript": "^6.0.0", 121 | "@codemirror/language": "^6.4.0", 122 | "@codemirror/state": "^6.0.0", 123 | "@codemirror/view": "^6.2.2", 124 | "@lezer/common": "^1.0.0", 125 | "@lezer/css": "^1.1.0", 126 | "@lezer/html": "^1.3.0" 127 | } 128 | }, 129 | "node_modules/@codemirror/lang-java": { 130 | "version": "6.0.1", 131 | "resolved": "https://registry.npmjs.org/@codemirror/lang-java/-/lang-java-6.0.1.tgz", 132 | "integrity": "sha512-OOnmhH67h97jHzCuFaIEspbmsT98fNdhVhmA3zCxW0cn7l8rChDhZtwiwJ/JOKXgfm4J+ELxQihxaI7bj7mJRg==", 133 | "dependencies": { 134 | "@codemirror/language": "^6.0.0", 135 | "@lezer/java": "^1.0.0" 136 | } 137 | }, 138 | "node_modules/@codemirror/lang-javascript": { 139 | "version": "6.1.7", 140 | "resolved": "https://registry.npmjs.org/@codemirror/lang-javascript/-/lang-javascript-6.1.7.tgz", 141 | "integrity": "sha512-KXKqxlZ4W6t5I7i2ScmITUD3f/F5Cllk3kj0De9P9mFeYVfhOVOWuDLgYiLpk357u7Xh4dhqjJAnsNPPoTLghQ==", 142 | "dependencies": { 143 | "@codemirror/autocomplete": "^6.0.0", 144 | "@codemirror/language": "^6.6.0", 145 | "@codemirror/lint": "^6.0.0", 146 | "@codemirror/state": "^6.0.0", 147 | "@codemirror/view": "^6.0.0", 148 | "@lezer/common": "^1.0.0", 149 | "@lezer/javascript": "^1.0.0" 150 | } 151 | }, 152 | "node_modules/@codemirror/lang-json": { 153 | "version": "6.0.1", 154 | "resolved": "https://registry.npmjs.org/@codemirror/lang-json/-/lang-json-6.0.1.tgz", 155 | "integrity": "sha512-+T1flHdgpqDDlJZ2Lkil/rLiRy684WMLc74xUnjJH48GQdfJo/pudlTRreZmKwzP8/tGdKf83wlbAdOCzlJOGQ==", 156 | "dependencies": { 157 | "@codemirror/language": "^6.0.0", 158 | "@lezer/json": "^1.0.0" 159 | } 160 | }, 161 | "node_modules/@codemirror/lang-markdown": { 162 | "version": "6.1.1", 163 | "resolved": "https://registry.npmjs.org/@codemirror/lang-markdown/-/lang-markdown-6.1.1.tgz", 164 | "integrity": "sha512-n87Ms6Y5UYb1UkFu8sRzTLfq/yyF1y2AYiWvaVdbBQi5WDj1tFk5N+AKA+WC0Jcjc1VxvrCCM0iizjdYYi9sFQ==", 165 | "dependencies": { 166 | "@codemirror/lang-html": "^6.0.0", 167 | "@codemirror/language": "^6.3.0", 168 | "@codemirror/state": "^6.0.0", 169 | "@codemirror/view": "^6.0.0", 170 | "@lezer/common": "^1.0.0", 171 | "@lezer/markdown": "^1.0.0" 172 | } 173 | }, 174 | "node_modules/@codemirror/lang-php": { 175 | "version": "6.0.1", 176 | "resolved": "https://registry.npmjs.org/@codemirror/lang-php/-/lang-php-6.0.1.tgz", 177 | "integrity": "sha512-ublojMdw/PNWa7qdN5TMsjmqkNuTBD3k6ndZ4Z0S25SBAiweFGyY68AS3xNcIOlb6DDFDvKlinLQ40vSLqf8xA==", 178 | "dependencies": { 179 | "@codemirror/lang-html": "^6.0.0", 180 | "@codemirror/language": "^6.0.0", 181 | "@codemirror/state": "^6.0.0", 182 | "@lezer/common": "^1.0.0", 183 | "@lezer/php": "^1.0.0" 184 | } 185 | }, 186 | "node_modules/@codemirror/lang-python": { 187 | "version": "6.1.2", 188 | "resolved": "https://registry.npmjs.org/@codemirror/lang-python/-/lang-python-6.1.2.tgz", 189 | "integrity": "sha512-nbQfifLBZstpt6Oo4XxA2LOzlSp4b/7Bc5cmodG1R+Cs5PLLCTUvsMNWDnziiCfTOG/SW1rVzXq/GbIr6WXlcw==", 190 | "dependencies": { 191 | "@codemirror/autocomplete": "^6.3.2", 192 | "@codemirror/language": "^6.0.0", 193 | "@lezer/python": "^1.0.0" 194 | } 195 | }, 196 | "node_modules/@codemirror/lang-rust": { 197 | "version": "6.0.1", 198 | "resolved": "https://registry.npmjs.org/@codemirror/lang-rust/-/lang-rust-6.0.1.tgz", 199 | "integrity": "sha512-344EMWFBzWArHWdZn/NcgkwMvZIWUR1GEBdwG8FEp++6o6vT6KL9V7vGs2ONsKxxFUPXKI0SPcWhyYyl2zPYxQ==", 200 | "dependencies": { 201 | "@codemirror/language": "^6.0.0", 202 | "@lezer/rust": "^1.0.0" 203 | } 204 | }, 205 | "node_modules/@codemirror/lang-sass": { 206 | "version": "6.0.1", 207 | "resolved": "https://registry.npmjs.org/@codemirror/lang-sass/-/lang-sass-6.0.1.tgz", 208 | "integrity": "sha512-USy9zqtdLYxSuqq0s4peMoQi+BDzyOyO7chUzli+X2xVCjmBhc3CsWQ4kkDU0NYtCHHFQRkcFO8770eaOwZqfw==", 209 | "dependencies": { 210 | "@codemirror/lang-css": "^6.1.1", 211 | "@codemirror/language": "^6.0.0", 212 | "@codemirror/state": "^6.0.0", 213 | "@lezer/common": "^1.0.2", 214 | "@lezer/sass": "^1.0.0" 215 | } 216 | }, 217 | "node_modules/@codemirror/lang-sql": { 218 | "version": "6.4.1", 219 | "resolved": "https://registry.npmjs.org/@codemirror/lang-sql/-/lang-sql-6.4.1.tgz", 220 | "integrity": "sha512-PFB56L+A0WGY35uRya+Trt5g19V9k2V9X3c55xoFW4RgiATr/yLqWsbbnEsdxuMn5tLpuikp7Kmj9smRsqBXAg==", 221 | "dependencies": { 222 | "@codemirror/autocomplete": "^6.0.0", 223 | "@codemirror/language": "^6.0.0", 224 | "@codemirror/state": "^6.0.0", 225 | "@lezer/highlight": "^1.0.0", 226 | "@lezer/lr": "^1.0.0" 227 | } 228 | }, 229 | "node_modules/@codemirror/lang-vue": { 230 | "version": "0.1.1", 231 | "resolved": "https://registry.npmjs.org/@codemirror/lang-vue/-/lang-vue-0.1.1.tgz", 232 | "integrity": "sha512-GIfc/MemCFKUdNSYGTFZDN8XsD2z0DUY7DgrK34on0dzdZ/CawZbi+SADYfVzWoPPdxngHzLhqlR5pSOqyPCvA==", 233 | "dependencies": { 234 | "@codemirror/lang-html": "^6.0.0", 235 | "@codemirror/lang-javascript": "^6.1.2", 236 | "@codemirror/language": "^6.0.0", 237 | "@lezer/common": "^1.0.0", 238 | "@lezer/highlight": "^1.0.0", 239 | "@lezer/lr": "^1.3.1" 240 | } 241 | }, 242 | "node_modules/@codemirror/lang-wast": { 243 | "version": "6.0.1", 244 | "resolved": "https://registry.npmjs.org/@codemirror/lang-wast/-/lang-wast-6.0.1.tgz", 245 | "integrity": "sha512-sQLsqhRjl2MWG3rxZysX+2XAyed48KhLBHLgq9xcKxIJu3npH/G+BIXW5NM5mHeDUjG0jcGh9BcjP0NfMStuzA==", 246 | "dependencies": { 247 | "@codemirror/language": "^6.0.0", 248 | "@lezer/highlight": "^1.0.0", 249 | "@lezer/lr": "^1.0.0" 250 | } 251 | }, 252 | "node_modules/@codemirror/lang-xml": { 253 | "version": "6.0.2", 254 | "resolved": "https://registry.npmjs.org/@codemirror/lang-xml/-/lang-xml-6.0.2.tgz", 255 | "integrity": "sha512-JQYZjHL2LAfpiZI2/qZ/qzDuSqmGKMwyApYmEUUCTxLM4MWS7sATUEfIguZQr9Zjx/7gcdnewb039smF6nC2zw==", 256 | "dependencies": { 257 | "@codemirror/autocomplete": "^6.0.0", 258 | "@codemirror/language": "^6.4.0", 259 | "@codemirror/state": "^6.0.0", 260 | "@lezer/common": "^1.0.0", 261 | "@lezer/xml": "^1.0.0" 262 | } 263 | }, 264 | "node_modules/@codemirror/language": { 265 | "version": "6.6.0", 266 | "resolved": "https://registry.npmjs.org/@codemirror/language/-/language-6.6.0.tgz", 267 | "integrity": "sha512-cwUd6lzt3MfNYOobdjf14ZkLbJcnv4WtndYaoBkbor/vF+rCNguMPK0IRtvZJG4dsWiaWPcK8x1VijhvSxnstg==", 268 | "dependencies": { 269 | "@codemirror/state": "^6.0.0", 270 | "@codemirror/view": "^6.0.0", 271 | "@lezer/common": "^1.0.0", 272 | "@lezer/highlight": "^1.0.0", 273 | "@lezer/lr": "^1.0.0", 274 | "style-mod": "^4.0.0" 275 | } 276 | }, 277 | "node_modules/@codemirror/language-data": { 278 | "version": "6.3.0", 279 | "resolved": "https://registry.npmjs.org/@codemirror/language-data/-/language-data-6.3.0.tgz", 280 | "integrity": "sha512-D9tOZS38mK59jDs1Flqe8GgCdUAYI339SqBdwHJZwxgyXHsBc8RIhAlz2oXWGpvZeP/kVHy9LVfoBFgO02mx7w==", 281 | "dependencies": { 282 | "@codemirror/lang-angular": "^0.1.0", 283 | "@codemirror/lang-cpp": "^6.0.0", 284 | "@codemirror/lang-css": "^6.0.0", 285 | "@codemirror/lang-html": "^6.0.0", 286 | "@codemirror/lang-java": "^6.0.0", 287 | "@codemirror/lang-javascript": "^6.0.0", 288 | "@codemirror/lang-json": "^6.0.0", 289 | "@codemirror/lang-markdown": "^6.0.0", 290 | "@codemirror/lang-php": "^6.0.0", 291 | "@codemirror/lang-python": "^6.0.0", 292 | "@codemirror/lang-rust": "^6.0.0", 293 | "@codemirror/lang-sass": "^6.0.0", 294 | "@codemirror/lang-sql": "^6.0.0", 295 | "@codemirror/lang-vue": "^0.1.1", 296 | "@codemirror/lang-wast": "^6.0.0", 297 | "@codemirror/lang-xml": "^6.0.0", 298 | "@codemirror/language": "^6.0.0", 299 | "@codemirror/legacy-modes": "^6.1.0" 300 | } 301 | }, 302 | "node_modules/@codemirror/legacy-modes": { 303 | "version": "6.3.2", 304 | "resolved": "https://registry.npmjs.org/@codemirror/legacy-modes/-/legacy-modes-6.3.2.tgz", 305 | "integrity": "sha512-ki5sqNKWzKi5AKvpVE6Cna4Q+SgxYuYVLAZFSsMjGBWx5qSVa+D+xipix65GS3f2syTfAD9pXKMX4i4p49eneQ==", 306 | "dependencies": { 307 | "@codemirror/language": "^6.0.0" 308 | } 309 | }, 310 | "node_modules/@codemirror/lint": { 311 | "version": "6.2.1", 312 | "resolved": "https://registry.npmjs.org/@codemirror/lint/-/lint-6.2.1.tgz", 313 | "integrity": "sha512-y1muai5U/uUPAGRyHMx9mHuHLypPcHWxzlZGknp/U5Mdb5Ol8Q5ZLp67UqyTbNFJJ3unVxZ8iX3g1fMN79S1JQ==", 314 | "dependencies": { 315 | "@codemirror/state": "^6.0.0", 316 | "@codemirror/view": "^6.0.0", 317 | "crelt": "^1.0.5" 318 | } 319 | }, 320 | "node_modules/@codemirror/search": { 321 | "version": "6.3.0", 322 | "resolved": "https://registry.npmjs.org/@codemirror/search/-/search-6.3.0.tgz", 323 | "integrity": "sha512-rBhZxzT34CarfhgCZGhaLBScABDN3iqJxixzNuINp9lrb3lzm0nTpR77G1VrxGO3HOGK7j62jcJftQM7eCOIuw==", 324 | "dependencies": { 325 | "@codemirror/state": "^6.0.0", 326 | "@codemirror/view": "^6.0.0", 327 | "crelt": "^1.0.5" 328 | } 329 | }, 330 | "node_modules/@codemirror/state": { 331 | "version": "6.2.0", 332 | "resolved": "https://registry.npmjs.org/@codemirror/state/-/state-6.2.0.tgz", 333 | "integrity": "sha512-69QXtcrsc3RYtOtd+GsvczJ319udtBf1PTrr2KbLWM/e2CXUPnh0Nz9AUo8WfhSQ7GeL8dPVNUmhQVgpmuaNGA==" 334 | }, 335 | "node_modules/@codemirror/theme-one-dark": { 336 | "version": "6.1.2", 337 | "resolved": "https://registry.npmjs.org/@codemirror/theme-one-dark/-/theme-one-dark-6.1.2.tgz", 338 | "integrity": "sha512-F+sH0X16j/qFLMAfbciKTxVOwkdAS336b7AXTKOZhy8BR3eH/RelsnLgLFINrpST63mmN2OuwUt0W2ndUgYwUA==", 339 | "dependencies": { 340 | "@codemirror/language": "^6.0.0", 341 | "@codemirror/state": "^6.0.0", 342 | "@codemirror/view": "^6.0.0", 343 | "@lezer/highlight": "^1.0.0" 344 | } 345 | }, 346 | "node_modules/@codemirror/view": { 347 | "version": "6.9.6", 348 | "resolved": "https://registry.npmjs.org/@codemirror/view/-/view-6.9.6.tgz", 349 | "integrity": "sha512-g68PxS3RkHpxfYS6DTWCy1jeA5/oHzmdWjMVPkOzqQyxpElHEcPncUd4EeMVSa4okt0sS3hNXVaRnJqO/7MeJw==", 350 | "dependencies": { 351 | "@codemirror/state": "^6.1.4", 352 | "style-mod": "^4.0.0", 353 | "w3c-keyname": "^2.2.4" 354 | } 355 | }, 356 | "node_modules/@jridgewell/gen-mapping": { 357 | "version": "0.3.3", 358 | "resolved": "https://registry.npmjs.org/@jridgewell/gen-mapping/-/gen-mapping-0.3.3.tgz", 359 | "integrity": "sha512-HLhSWOLRi875zjjMG/r+Nv0oCW8umGb0BgEhyX3dDX3egwZtB8PqLnjz3yedt8R5StBrzcg4aBpnh8UA9D1BoQ==", 360 | "dependencies": { 361 | "@jridgewell/set-array": "^1.0.1", 362 | "@jridgewell/sourcemap-codec": "^1.4.10", 363 | "@jridgewell/trace-mapping": "^0.3.9" 364 | }, 365 | "engines": { 366 | "node": ">=6.0.0" 367 | } 368 | }, 369 | "node_modules/@jridgewell/resolve-uri": { 370 | "version": "3.1.0", 371 | "resolved": "https://registry.npmjs.org/@jridgewell/resolve-uri/-/resolve-uri-3.1.0.tgz", 372 | "integrity": "sha512-F2msla3tad+Mfht5cJq7LSXcdudKTWCVYUgw6pLFOOHSTtZlj6SWNYAp+AhuqLmWdBO2X5hPrLcu8cVP8fy28w==", 373 | "engines": { 374 | "node": ">=6.0.0" 375 | } 376 | }, 377 | "node_modules/@jridgewell/set-array": { 378 | "version": "1.1.2", 379 | "resolved": "https://registry.npmjs.org/@jridgewell/set-array/-/set-array-1.1.2.tgz", 380 | "integrity": "sha512-xnkseuNADM0gt2bs+BvhO0p78Mk762YnZdsuzFV018NoG1Sj1SCQvpSqa7XUaTam5vAGasABV9qXASMKnFMwMw==", 381 | "engines": { 382 | "node": ">=6.0.0" 383 | } 384 | }, 385 | "node_modules/@jridgewell/source-map": { 386 | "version": "0.3.3", 387 | "resolved": "https://registry.npmjs.org/@jridgewell/source-map/-/source-map-0.3.3.tgz", 388 | "integrity": "sha512-b+fsZXeLYi9fEULmfBrhxn4IrPlINf8fiNarzTof004v3lFdntdwa9PF7vFJqm3mg7s+ScJMxXaE3Acp1irZcg==", 389 | "dependencies": { 390 | "@jridgewell/gen-mapping": "^0.3.0", 391 | "@jridgewell/trace-mapping": "^0.3.9" 392 | } 393 | }, 394 | "node_modules/@jridgewell/sourcemap-codec": { 395 | "version": "1.4.15", 396 | "resolved": "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.4.15.tgz", 397 | "integrity": "sha512-eF2rxCRulEKXHTRiDrDy6erMYWqNw4LPdQ8UQA4huuxaQsVeRPFl2oM8oDGxMFhJUWZf9McpLtJasDDZb/Bpeg==" 398 | }, 399 | "node_modules/@jridgewell/trace-mapping": { 400 | "version": "0.3.18", 401 | "resolved": "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.18.tgz", 402 | "integrity": "sha512-w+niJYzMHdd7USdiH2U6869nqhD2nbfZXND5Yp93qIbEmnDNk7PD48o+YchRVpzMU7M6jVCbenTR7PA1FLQ9pA==", 403 | "dependencies": { 404 | "@jridgewell/resolve-uri": "3.1.0", 405 | "@jridgewell/sourcemap-codec": "1.4.14" 406 | } 407 | }, 408 | "node_modules/@jridgewell/trace-mapping/node_modules/@jridgewell/sourcemap-codec": { 409 | "version": "1.4.14", 410 | "resolved": "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.4.14.tgz", 411 | "integrity": "sha512-XPSJHWmi394fuUuzDnGz1wiKqWfo1yXecHQMRf2l6hztTO+nPru658AyDngaBe7isIxEkRsPR3FZh+s7iVa4Uw==" 412 | }, 413 | "node_modules/@lezer/common": { 414 | "version": "1.0.2", 415 | "resolved": "https://registry.npmjs.org/@lezer/common/-/common-1.0.2.tgz", 416 | "integrity": "sha512-SVgiGtMnMnW3ActR8SXgsDhw7a0w0ChHSYAyAUxxrOiJ1OqYWEKk/xJd84tTSPo1mo6DXLObAJALNnd0Hrv7Ng==" 417 | }, 418 | "node_modules/@lezer/cpp": { 419 | "version": "1.1.0", 420 | "resolved": "https://registry.npmjs.org/@lezer/cpp/-/cpp-1.1.0.tgz", 421 | "integrity": "sha512-zUHrjNFuY/DOZCkOBJ6qItQIkcopHM/Zv/QOE0a4XNG3HDNahxTNu5fQYl8dIuKCpxCqRdMl5cEwl5zekFc7BA==", 422 | "dependencies": { 423 | "@lezer/highlight": "^1.0.0", 424 | "@lezer/lr": "^1.0.0" 425 | } 426 | }, 427 | "node_modules/@lezer/css": { 428 | "version": "1.1.1", 429 | "resolved": "https://registry.npmjs.org/@lezer/css/-/css-1.1.1.tgz", 430 | "integrity": "sha512-mSjx+unLLapEqdOYDejnGBokB5+AiJKZVclmud0MKQOKx3DLJ5b5VTCstgDDknR6iIV4gVrN6euzsCnj0A2gQA==", 431 | "dependencies": { 432 | "@lezer/highlight": "^1.0.0", 433 | "@lezer/lr": "^1.0.0" 434 | } 435 | }, 436 | "node_modules/@lezer/highlight": { 437 | "version": "1.1.4", 438 | "resolved": "https://registry.npmjs.org/@lezer/highlight/-/highlight-1.1.4.tgz", 439 | "integrity": "sha512-IECkFmw2l7sFcYXrV8iT9GeY4W0fU4CxX0WMwhmhMIVjoDdD1Hr6q3G2NqVtLg/yVe5n7i4menG3tJ2r4eCrPQ==", 440 | "dependencies": { 441 | "@lezer/common": "^1.0.0" 442 | } 443 | }, 444 | "node_modules/@lezer/html": { 445 | "version": "1.3.4", 446 | "resolved": "https://registry.npmjs.org/@lezer/html/-/html-1.3.4.tgz", 447 | "integrity": "sha512-HdJYMVZcT4YsMo7lW3ipL4NoyS2T67kMPuSVS5TgLGqmaCjEU/D6xv7zsa1ktvTK5lwk7zzF1e3eU6gBZIPm5g==", 448 | "dependencies": { 449 | "@lezer/common": "^1.0.0", 450 | "@lezer/highlight": "^1.0.0", 451 | "@lezer/lr": "^1.0.0" 452 | } 453 | }, 454 | "node_modules/@lezer/java": { 455 | "version": "1.0.3", 456 | "resolved": "https://registry.npmjs.org/@lezer/java/-/java-1.0.3.tgz", 457 | "integrity": "sha512-kKN17wmgP1cgHb8juR4pwVSPMKkDMzY/lAPbBsZ1fpXwbk2sg3N1kIrf0q+LefxgrANaQb/eNO7+m2QPruTFng==", 458 | "dependencies": { 459 | "@lezer/highlight": "^1.0.0", 460 | "@lezer/lr": "^1.0.0" 461 | } 462 | }, 463 | "node_modules/@lezer/javascript": { 464 | "version": "1.4.3", 465 | "resolved": "https://registry.npmjs.org/@lezer/javascript/-/javascript-1.4.3.tgz", 466 | "integrity": "sha512-k7Eo9z9B1supZ5cCD4ilQv/RZVN30eUQL+gGbr6ybrEY3avBAL5MDiYi2aa23Aj0A79ry4rJRvPAwE2TM8bd+A==", 467 | "dependencies": { 468 | "@lezer/highlight": "^1.1.3", 469 | "@lezer/lr": "^1.3.0" 470 | } 471 | }, 472 | "node_modules/@lezer/json": { 473 | "version": "1.0.0", 474 | "resolved": "https://registry.npmjs.org/@lezer/json/-/json-1.0.0.tgz", 475 | "integrity": "sha512-zbAuUY09RBzCoCA3lJ1+ypKw5WSNvLqGMtasdW6HvVOqZoCpPr8eWrsGnOVWGKGn8Rh21FnrKRVlJXrGAVUqRw==", 476 | "dependencies": { 477 | "@lezer/highlight": "^1.0.0", 478 | "@lezer/lr": "^1.0.0" 479 | } 480 | }, 481 | "node_modules/@lezer/lr": { 482 | "version": "1.3.4", 483 | "resolved": "https://registry.npmjs.org/@lezer/lr/-/lr-1.3.4.tgz", 484 | "integrity": "sha512-7o+e4og/QoC/6btozDPJqnzBhUaD1fMfmvnEKQO1wRRiTse1WxaJ3OMEXZJnkgT6HCcTVOctSoXK9jGJw2oe9g==", 485 | "dependencies": { 486 | "@lezer/common": "^1.0.0" 487 | } 488 | }, 489 | "node_modules/@lezer/markdown": { 490 | "version": "1.0.2", 491 | "resolved": "https://registry.npmjs.org/@lezer/markdown/-/markdown-1.0.2.tgz", 492 | "integrity": "sha512-8CY0OoZ6V5EzPjSPeJ4KLVbtXdLBd8V6sRCooN5kHnO28ytreEGTyrtU/zUwo/XLRzGr/e1g44KlzKi3yWGB5A==", 493 | "dependencies": { 494 | "@lezer/common": "^1.0.0", 495 | "@lezer/highlight": "^1.0.0" 496 | } 497 | }, 498 | "node_modules/@lezer/php": { 499 | "version": "1.0.1", 500 | "resolved": "https://registry.npmjs.org/@lezer/php/-/php-1.0.1.tgz", 501 | "integrity": "sha512-aqdCQJOXJ66De22vzdwnuC502hIaG9EnPK2rSi+ebXyUd+j7GAX1mRjWZOVOmf3GST1YUfUCu6WXDiEgDGOVwA==", 502 | "dependencies": { 503 | "@lezer/highlight": "^1.0.0", 504 | "@lezer/lr": "^1.1.0" 505 | } 506 | }, 507 | "node_modules/@lezer/python": { 508 | "version": "1.1.4", 509 | "resolved": "https://registry.npmjs.org/@lezer/python/-/python-1.1.4.tgz", 510 | "integrity": "sha512-x82XgYxqqX0Yiw7uIemQJ3z2QyQme5BYpectkPfNg99OQrakqfwqVolqEVIrsj4QO9rVDLFZZ49J0Vbne7UbAA==", 511 | "dependencies": { 512 | "@lezer/highlight": "^1.0.0", 513 | "@lezer/lr": "^1.0.0" 514 | } 515 | }, 516 | "node_modules/@lezer/rust": { 517 | "version": "1.0.0", 518 | "resolved": "https://registry.npmjs.org/@lezer/rust/-/rust-1.0.0.tgz", 519 | "integrity": "sha512-IpGAxIjNxYmX9ra6GfQTSPegdCAWNeq23WNmrsMMQI7YNSvKtYxO4TX5rgZUmbhEucWn0KTBMeDEPXg99YKtTA==", 520 | "dependencies": { 521 | "@lezer/highlight": "^1.0.0", 522 | "@lezer/lr": "^1.0.0" 523 | } 524 | }, 525 | "node_modules/@lezer/sass": { 526 | "version": "1.0.1", 527 | "resolved": "https://registry.npmjs.org/@lezer/sass/-/sass-1.0.1.tgz", 528 | "integrity": "sha512-S/aYAzABzMqWLfKKqV89pCWME4yjZYC6xzD02l44wbmb0sHxmN9/8aE4GULrKFzFaGazHdXcGEbPZ4zzB6yqwQ==", 529 | "dependencies": { 530 | "@lezer/highlight": "^1.0.0", 531 | "@lezer/lr": "^1.0.0" 532 | } 533 | }, 534 | "node_modules/@lezer/xml": { 535 | "version": "1.0.1", 536 | "resolved": "https://registry.npmjs.org/@lezer/xml/-/xml-1.0.1.tgz", 537 | "integrity": "sha512-jMDXrV953sDAUEMI25VNrI9dz94Ai96FfeglytFINhhwQ867HKlCE2jt3AwZTCT7M528WxdDWv/Ty8e9wizwmQ==", 538 | "dependencies": { 539 | "@lezer/highlight": "^1.0.0", 540 | "@lezer/lr": "^1.0.0" 541 | } 542 | }, 543 | "node_modules/@rollup/plugin-node-resolve": { 544 | "version": "13.3.0", 545 | "resolved": "https://registry.npmjs.org/@rollup/plugin-node-resolve/-/plugin-node-resolve-13.3.0.tgz", 546 | "integrity": "sha512-Lus8rbUo1eEcnS4yTFKLZrVumLPY+YayBdWXgFSHYhTT2iJbMhoaaBL3xl5NCdeRytErGr8tZ0L71BMRmnlwSw==", 547 | "dependencies": { 548 | "@rollup/pluginutils": "^3.1.0", 549 | "@types/resolve": "1.17.1", 550 | "deepmerge": "^4.2.2", 551 | "is-builtin-module": "^3.1.0", 552 | "is-module": "^1.0.0", 553 | "resolve": "^1.19.0" 554 | }, 555 | "engines": { 556 | "node": ">= 10.0.0" 557 | }, 558 | "peerDependencies": { 559 | "rollup": "^2.42.0" 560 | } 561 | }, 562 | "node_modules/@rollup/pluginutils": { 563 | "version": "3.1.0", 564 | "resolved": "https://registry.npmjs.org/@rollup/pluginutils/-/pluginutils-3.1.0.tgz", 565 | "integrity": "sha512-GksZ6pr6TpIjHm8h9lSQ8pi8BE9VeubNT0OMJ3B5uZJ8pz73NPiqOtCog/x2/QzM1ENChPKxMDhiQuRHsqc+lg==", 566 | "dependencies": { 567 | "@types/estree": "0.0.39", 568 | "estree-walker": "^1.0.1", 569 | "picomatch": "^2.2.2" 570 | }, 571 | "engines": { 572 | "node": ">= 8.0.0" 573 | }, 574 | "peerDependencies": { 575 | "rollup": "^1.20.0||^2.0.0" 576 | } 577 | }, 578 | "node_modules/@types/estree": { 579 | "version": "0.0.39", 580 | "resolved": "https://registry.npmjs.org/@types/estree/-/estree-0.0.39.tgz", 581 | "integrity": "sha512-EYNwp3bU+98cpU4lAWYYL7Zz+2gryWH1qbdDTidVd6hkiR6weksdbMadyXKXNPEkQFhXM+hVO9ZygomHXp+AIw==" 582 | }, 583 | "node_modules/@types/node": { 584 | "version": "18.16.0", 585 | "resolved": "https://registry.npmjs.org/@types/node/-/node-18.16.0.tgz", 586 | "integrity": "sha512-BsAaKhB+7X+H4GnSjGhJG9Qi8Tw+inU9nJDwmD5CgOmBLEI6ArdhikpLX7DjbjDRDTbqZzU2LSQNZg8WGPiSZQ==" 587 | }, 588 | "node_modules/@types/resolve": { 589 | "version": "1.17.1", 590 | "resolved": "https://registry.npmjs.org/@types/resolve/-/resolve-1.17.1.tgz", 591 | "integrity": "sha512-yy7HuzQhj0dhGpD8RLXSZWEkLsV9ibvxvi6EiJ3bkqLAO1RGo0WbkWQiwpRlSFymTJRz0d3k5LM3kkx8ArDbLw==", 592 | "dependencies": { 593 | "@types/node": "*" 594 | } 595 | }, 596 | "node_modules/acorn": { 597 | "version": "8.8.2", 598 | "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.8.2.tgz", 599 | "integrity": "sha512-xjIYgE8HBrkpd/sJqOGNspf8uHG+NOHGOw6a/Urj8taM2EXfdNAH2oFcPeIFfsv3+kz/mJrS5VuMqbNLjCa2vw==", 600 | "bin": { 601 | "acorn": "bin/acorn" 602 | }, 603 | "engines": { 604 | "node": ">=0.4.0" 605 | } 606 | }, 607 | "node_modules/ansi-styles": { 608 | "version": "3.2.1", 609 | "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", 610 | "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", 611 | "dependencies": { 612 | "color-convert": "^1.9.0" 613 | }, 614 | "engines": { 615 | "node": ">=4" 616 | } 617 | }, 618 | "node_modules/buffer-from": { 619 | "version": "1.1.2", 620 | "resolved": "https://registry.npmjs.org/buffer-from/-/buffer-from-1.1.2.tgz", 621 | "integrity": "sha512-E+XQCRwSbaaiChtv6k6Dwgc+bx+Bs6vuKJHHl5kox/BaKbhiXzqQOwK4cO22yElGp2OCmjwVhT3HmxgyPGnJfQ==" 622 | }, 623 | "node_modules/builtin-modules": { 624 | "version": "3.3.0", 625 | "resolved": "https://registry.npmjs.org/builtin-modules/-/builtin-modules-3.3.0.tgz", 626 | "integrity": "sha512-zhaCDicdLuWN5UbN5IMnFqNMhNfo919sH85y2/ea+5Yg9TsTkeZxpL+JLbp6cgYFS4sRLp3YV4S6yDuqVWHYOw==", 627 | "engines": { 628 | "node": ">=6" 629 | }, 630 | "funding": { 631 | "url": "https://github.com/sponsors/sindresorhus" 632 | } 633 | }, 634 | "node_modules/chalk": { 635 | "version": "2.4.2", 636 | "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", 637 | "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", 638 | "dependencies": { 639 | "ansi-styles": "^3.2.1", 640 | "escape-string-regexp": "^1.0.5", 641 | "supports-color": "^5.3.0" 642 | }, 643 | "engines": { 644 | "node": ">=4" 645 | } 646 | }, 647 | "node_modules/codemirror": { 648 | "version": "6.0.1", 649 | "resolved": "https://registry.npmjs.org/codemirror/-/codemirror-6.0.1.tgz", 650 | "integrity": "sha512-J8j+nZ+CdWmIeFIGXEFbFPtpiYacFMDR8GlHK3IyHQJMCaVRfGx9NT+Hxivv1ckLWPvNdZqndbr/7lVhrf/Svg==", 651 | "dependencies": { 652 | "@codemirror/autocomplete": "^6.0.0", 653 | "@codemirror/commands": "^6.0.0", 654 | "@codemirror/language": "^6.0.0", 655 | "@codemirror/lint": "^6.0.0", 656 | "@codemirror/search": "^6.0.0", 657 | "@codemirror/state": "^6.0.0", 658 | "@codemirror/view": "^6.0.0" 659 | } 660 | }, 661 | "node_modules/color-convert": { 662 | "version": "1.9.3", 663 | "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", 664 | "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", 665 | "dependencies": { 666 | "color-name": "1.1.3" 667 | } 668 | }, 669 | "node_modules/color-name": { 670 | "version": "1.1.3", 671 | "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", 672 | "integrity": "sha512-72fSenhMw2HZMTVHeCA9KCmpEIbzWiQsjN+BHcBbS9vr1mtt+vJjPdksIBNUmKAW8TFUDPJK5SUU3QhE9NEXDw==" 673 | }, 674 | "node_modules/commander": { 675 | "version": "2.20.3", 676 | "resolved": "https://registry.npmjs.org/commander/-/commander-2.20.3.tgz", 677 | "integrity": "sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ==" 678 | }, 679 | "node_modules/crelt": { 680 | "version": "1.0.5", 681 | "resolved": "https://registry.npmjs.org/crelt/-/crelt-1.0.5.tgz", 682 | "integrity": "sha512-+BO9wPPi+DWTDcNYhr/W90myha8ptzftZT+LwcmUbbok0rcP/fequmFYCw8NMoH7pkAZQzU78b3kYrlua5a9eA==" 683 | }, 684 | "node_modules/deepmerge": { 685 | "version": "4.3.1", 686 | "resolved": "https://registry.npmjs.org/deepmerge/-/deepmerge-4.3.1.tgz", 687 | "integrity": "sha512-3sUqbMEc77XqpdNO7FRyRog+eW3ph+GYCbj+rK+uYyRMuwsVy0rMiVtPn+QJlKFvWP/1PYpapqYn0Me2knFn+A==", 688 | "engines": { 689 | "node": ">=0.10.0" 690 | } 691 | }, 692 | "node_modules/escape-string-regexp": { 693 | "version": "1.0.5", 694 | "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", 695 | "integrity": "sha512-vbRorB5FUQWvla16U8R/qgaFIya2qGzwDrNmCZuYKrbdSUMG6I1ZCGQRefkRVhuOkIGVne7BQ35DSfo1qvJqFg==", 696 | "engines": { 697 | "node": ">=0.8.0" 698 | } 699 | }, 700 | "node_modules/estree-walker": { 701 | "version": "1.0.1", 702 | "resolved": "https://registry.npmjs.org/estree-walker/-/estree-walker-1.0.1.tgz", 703 | "integrity": "sha512-1fMXF3YP4pZZVozF8j/ZLfvnR8NSIljt56UhbZ5PeeDmmGHpgpdwQt7ITlGvYaQukCvuBRMLEiKiYC+oeIg4cg==" 704 | }, 705 | "node_modules/fsevents": { 706 | "version": "2.3.2", 707 | "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.2.tgz", 708 | "integrity": "sha512-xiqMQR4xAeHTuB9uWm+fFRcIOgKBMiOBP+eXiyT7jsgVCq1bkVygt00oASowB7EdtpOHaaPgKt812P9ab+DDKA==", 709 | "hasInstallScript": true, 710 | "optional": true, 711 | "os": [ 712 | "darwin" 713 | ], 714 | "engines": { 715 | "node": "^8.16.0 || ^10.6.0 || >=11.0.0" 716 | } 717 | }, 718 | "node_modules/function-bind": { 719 | "version": "1.1.1", 720 | "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.1.tgz", 721 | "integrity": "sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==" 722 | }, 723 | "node_modules/has": { 724 | "version": "1.0.3", 725 | "resolved": "https://registry.npmjs.org/has/-/has-1.0.3.tgz", 726 | "integrity": "sha512-f2dvO0VU6Oej7RkWJGrehjbzMAjFp5/VKPp5tTpWIV4JHHZK1/BxbFRtf/siA2SWTe09caDmVtYYzWEIbBS4zw==", 727 | "dependencies": { 728 | "function-bind": "^1.1.1" 729 | }, 730 | "engines": { 731 | "node": ">= 0.4.0" 732 | } 733 | }, 734 | "node_modules/has-flag": { 735 | "version": "3.0.0", 736 | "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", 737 | "integrity": "sha512-sKJf1+ceQBr4SMkvQnBDNDtf4TXpVhVGateu0t918bl30FnbE2m4vNLX+VWe/dpjlb+HugGYzW7uQXH98HPEYw==", 738 | "engines": { 739 | "node": ">=4" 740 | } 741 | }, 742 | "node_modules/is-builtin-module": { 743 | "version": "3.2.1", 744 | "resolved": "https://registry.npmjs.org/is-builtin-module/-/is-builtin-module-3.2.1.tgz", 745 | "integrity": "sha512-BSLE3HnV2syZ0FK0iMA/yUGplUeMmNz4AW5fnTunbCIqZi4vG3WjJT9FHMy5D69xmAYBHXQhJdALdpwVxV501A==", 746 | "dependencies": { 747 | "builtin-modules": "^3.3.0" 748 | }, 749 | "engines": { 750 | "node": ">=6" 751 | }, 752 | "funding": { 753 | "url": "https://github.com/sponsors/sindresorhus" 754 | } 755 | }, 756 | "node_modules/is-core-module": { 757 | "version": "2.12.0", 758 | "resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.12.0.tgz", 759 | "integrity": "sha512-RECHCBCd/viahWmwj6enj19sKbHfJrddi/6cBDsNTKbNq0f7VeaUkBo60BqzvPqo/W54ChS62Z5qyun7cfOMqQ==", 760 | "dependencies": { 761 | "has": "^1.0.3" 762 | }, 763 | "funding": { 764 | "url": "https://github.com/sponsors/ljharb" 765 | } 766 | }, 767 | "node_modules/is-module": { 768 | "version": "1.0.0", 769 | "resolved": "https://registry.npmjs.org/is-module/-/is-module-1.0.0.tgz", 770 | "integrity": "sha512-51ypPSPCoTEIN9dy5Oy+h4pShgJmPCygKfyRCISBI+JoWT/2oJvK8QPxmwv7b/p239jXrm9M1mlQbyKJ5A152g==" 771 | }, 772 | "node_modules/jest-worker": { 773 | "version": "26.6.2", 774 | "resolved": "https://registry.npmjs.org/jest-worker/-/jest-worker-26.6.2.tgz", 775 | "integrity": "sha512-KWYVV1c4i+jbMpaBC+U++4Va0cp8OisU185o73T1vo99hqi7w8tSJfUXYswwqqrjzwxa6KpRK54WhPvwf5w6PQ==", 776 | "dependencies": { 777 | "@types/node": "*", 778 | "merge-stream": "^2.0.0", 779 | "supports-color": "^7.0.0" 780 | }, 781 | "engines": { 782 | "node": ">= 10.13.0" 783 | } 784 | }, 785 | "node_modules/jest-worker/node_modules/has-flag": { 786 | "version": "4.0.0", 787 | "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", 788 | "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", 789 | "engines": { 790 | "node": ">=8" 791 | } 792 | }, 793 | "node_modules/jest-worker/node_modules/supports-color": { 794 | "version": "7.2.0", 795 | "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", 796 | "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", 797 | "dependencies": { 798 | "has-flag": "^4.0.0" 799 | }, 800 | "engines": { 801 | "node": ">=8" 802 | } 803 | }, 804 | "node_modules/js-tokens": { 805 | "version": "4.0.0", 806 | "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz", 807 | "integrity": "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==" 808 | }, 809 | "node_modules/merge-stream": { 810 | "version": "2.0.0", 811 | "resolved": "https://registry.npmjs.org/merge-stream/-/merge-stream-2.0.0.tgz", 812 | "integrity": "sha512-abv/qOcuPfk3URPfDzmZU1LKmuw8kT+0nIHvKrKgFrwifol/doWcdA4ZqsWQ8ENrFKkd67Mfpo/LovbIUsbt3w==" 813 | }, 814 | "node_modules/path-parse": { 815 | "version": "1.0.7", 816 | "resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.7.tgz", 817 | "integrity": "sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw==" 818 | }, 819 | "node_modules/picomatch": { 820 | "version": "2.3.1", 821 | "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.1.tgz", 822 | "integrity": "sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==", 823 | "engines": { 824 | "node": ">=8.6" 825 | }, 826 | "funding": { 827 | "url": "https://github.com/sponsors/jonschlinkert" 828 | } 829 | }, 830 | "node_modules/randombytes": { 831 | "version": "2.1.0", 832 | "resolved": "https://registry.npmjs.org/randombytes/-/randombytes-2.1.0.tgz", 833 | "integrity": "sha512-vYl3iOX+4CKUWuxGi9Ukhie6fsqXqS9FE2Zaic4tNFD2N2QQaXOMFbuKK4QmDHC0JO6B1Zp41J0LpT0oR68amQ==", 834 | "dependencies": { 835 | "safe-buffer": "^5.1.0" 836 | } 837 | }, 838 | "node_modules/resolve": { 839 | "version": "1.22.2", 840 | "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.22.2.tgz", 841 | "integrity": "sha512-Sb+mjNHOULsBv818T40qSPeRiuWLyaGMa5ewydRLFimneixmVy2zdivRl+AF6jaYPC8ERxGDmFSiqui6SfPd+g==", 842 | "dependencies": { 843 | "is-core-module": "^2.11.0", 844 | "path-parse": "^1.0.7", 845 | "supports-preserve-symlinks-flag": "^1.0.0" 846 | }, 847 | "bin": { 848 | "resolve": "bin/resolve" 849 | }, 850 | "funding": { 851 | "url": "https://github.com/sponsors/ljharb" 852 | } 853 | }, 854 | "node_modules/rollup": { 855 | "version": "2.79.1", 856 | "resolved": "https://registry.npmjs.org/rollup/-/rollup-2.79.1.tgz", 857 | "integrity": "sha512-uKxbd0IhMZOhjAiD5oAFp7BqvkA4Dv47qpOCtaNvng4HBwdbWtdOh8f5nZNuk2rp51PMGk3bzfWu5oayNEuYnw==", 858 | "bin": { 859 | "rollup": "dist/bin/rollup" 860 | }, 861 | "engines": { 862 | "node": ">=10.0.0" 863 | }, 864 | "optionalDependencies": { 865 | "fsevents": "~2.3.2" 866 | } 867 | }, 868 | "node_modules/rollup-plugin-terser": { 869 | "version": "7.0.2", 870 | "resolved": "https://registry.npmjs.org/rollup-plugin-terser/-/rollup-plugin-terser-7.0.2.tgz", 871 | "integrity": "sha512-w3iIaU4OxcF52UUXiZNsNeuXIMDvFrr+ZXK6bFZ0Q60qyVfq4uLptoS4bbq3paG3x216eQllFZX7zt6TIImguQ==", 872 | "deprecated": "This package has been deprecated and is no longer maintained. Please use @rollup/plugin-terser", 873 | "dependencies": { 874 | "@babel/code-frame": "^7.10.4", 875 | "jest-worker": "^26.2.1", 876 | "serialize-javascript": "^4.0.0", 877 | "terser": "^5.0.0" 878 | }, 879 | "peerDependencies": { 880 | "rollup": "^2.0.0" 881 | } 882 | }, 883 | "node_modules/safe-buffer": { 884 | "version": "5.2.1", 885 | "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz", 886 | "integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==", 887 | "funding": [ 888 | { 889 | "type": "github", 890 | "url": "https://github.com/sponsors/feross" 891 | }, 892 | { 893 | "type": "patreon", 894 | "url": "https://www.patreon.com/feross" 895 | }, 896 | { 897 | "type": "consulting", 898 | "url": "https://feross.org/support" 899 | } 900 | ] 901 | }, 902 | "node_modules/serialize-javascript": { 903 | "version": "4.0.0", 904 | "resolved": "https://registry.npmjs.org/serialize-javascript/-/serialize-javascript-4.0.0.tgz", 905 | "integrity": "sha512-GaNA54380uFefWghODBWEGisLZFj00nS5ACs6yHa9nLqlLpVLO8ChDGeKRjZnV4Nh4n0Qi7nhYZD/9fCPzEqkw==", 906 | "dependencies": { 907 | "randombytes": "^2.1.0" 908 | } 909 | }, 910 | "node_modules/source-map": { 911 | "version": "0.6.1", 912 | "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", 913 | "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", 914 | "engines": { 915 | "node": ">=0.10.0" 916 | } 917 | }, 918 | "node_modules/source-map-support": { 919 | "version": "0.5.21", 920 | "resolved": "https://registry.npmjs.org/source-map-support/-/source-map-support-0.5.21.tgz", 921 | "integrity": "sha512-uBHU3L3czsIyYXKX88fdrGovxdSCoTGDRZ6SYXtSRxLZUzHg5P/66Ht6uoUlHu9EZod+inXhKo3qQgwXUT/y1w==", 922 | "dependencies": { 923 | "buffer-from": "^1.0.0", 924 | "source-map": "^0.6.0" 925 | } 926 | }, 927 | "node_modules/style-mod": { 928 | "version": "4.0.3", 929 | "resolved": "https://registry.npmjs.org/style-mod/-/style-mod-4.0.3.tgz", 930 | "integrity": "sha512-78Jv8kYJdjbvRwwijtCevYADfsI0lGzYJe4mMFdceO8l75DFFDoqBhR1jVDicDRRaX4//g1u9wKeo+ztc2h1Rw==" 931 | }, 932 | "node_modules/supports-color": { 933 | "version": "5.5.0", 934 | "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", 935 | "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", 936 | "dependencies": { 937 | "has-flag": "^3.0.0" 938 | }, 939 | "engines": { 940 | "node": ">=4" 941 | } 942 | }, 943 | "node_modules/supports-preserve-symlinks-flag": { 944 | "version": "1.0.0", 945 | "resolved": "https://registry.npmjs.org/supports-preserve-symlinks-flag/-/supports-preserve-symlinks-flag-1.0.0.tgz", 946 | "integrity": "sha512-ot0WnXS9fgdkgIcePe6RHNk1WA8+muPa6cSjeR3V8K27q9BB1rTE3R1p7Hv0z1ZyAc8s6Vvv8DIyWf681MAt0w==", 947 | "engines": { 948 | "node": ">= 0.4" 949 | }, 950 | "funding": { 951 | "url": "https://github.com/sponsors/ljharb" 952 | } 953 | }, 954 | "node_modules/terser": { 955 | "version": "5.17.1", 956 | "resolved": "https://registry.npmjs.org/terser/-/terser-5.17.1.tgz", 957 | "integrity": "sha512-hVl35zClmpisy6oaoKALOpS0rDYLxRFLHhRuDlEGTKey9qHjS1w9GMORjuwIMt70Wan4lwsLYyWDVnWgF+KUEw==", 958 | "dependencies": { 959 | "@jridgewell/source-map": "^0.3.2", 960 | "acorn": "^8.5.0", 961 | "commander": "^2.20.0", 962 | "source-map-support": "~0.5.20" 963 | }, 964 | "bin": { 965 | "terser": "bin/terser" 966 | }, 967 | "engines": { 968 | "node": ">=10" 969 | } 970 | }, 971 | "node_modules/w3c-keyname": { 972 | "version": "2.2.6", 973 | "resolved": "https://registry.npmjs.org/w3c-keyname/-/w3c-keyname-2.2.6.tgz", 974 | "integrity": "sha512-f+fciywl1SJEniZHD6H+kUO8gOnwIr7f4ijKA6+ZvJFjeGi1r4PDLl53Ayud9O/rk64RqgoQine0feoeOU0kXg==" 975 | } 976 | } 977 | } 978 | -------------------------------------------------------------------------------- /Sources/CodeMirror/src/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "dependencies": { 3 | "@codemirror/lang-css": "^6.0.0", 4 | "@codemirror/lang-html": "^6.0.0", 5 | "@codemirror/lang-javascript": "^6.0.0", 6 | "@codemirror/lang-json": "^6.0.0", 7 | "@codemirror/lang-xml": "^6.0.0", 8 | "@codemirror/language-data": "^6.0.0", 9 | "@codemirror/theme-one-dark": "^6.0.0", 10 | "@rollup/plugin-node-resolve": "^13.3.0", 11 | "codemirror": "^6.0.0", 12 | "rollup": "^2.75.6", 13 | "rollup-plugin-terser": "^7.0.2" 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /Sources/CodeMirror/src/rollup.config.js: -------------------------------------------------------------------------------- 1 | import { nodeResolve } from "@rollup/plugin-node-resolve"; 2 | import { terser } from "rollup-plugin-terser"; 3 | export default { 4 | input: "./editor.js", 5 | output: { 6 | file: "./build/editor.bundle.js", 7 | format: "umd", 8 | extend: true, 9 | name: "CodeMirror", 10 | exports: "named", 11 | plugins: [terser()], 12 | }, 13 | plugins: [nodeResolve()], 14 | }; 15 | --------------------------------------------------------------------------------