react-native-enriched-markdown 0.7.1 → 0.7.3

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.
@@ -68,6 +68,20 @@ Pod::Spec.new do |s|
68
68
  sed -i '' -E '/^(framework )?module RaTeXFFI /,/^\}/d' "$MODULEMAP"
69
69
  SCRIPT
70
70
  execution_position: :before_compile
71
+ },
72
+ {
73
+ name: 'Dedupe RaTeX XCFramework Signature',
74
+ script: <<~'SCRIPT',
75
+ # Xcode 26 generates a .signature file for each signed XCFramework.
76
+ # When the RaTeX XCFramework is consumed via spm_dependency inside a
77
+ # CocoaPods target, both the SPM product and the pod target produce a
78
+ # copy. During archive assembly Xcode copies all signatures into a flat
79
+ # Signatures/ directory, and the second copy collides with the first.
80
+ # Removing the pod-target copy prevents the collision. This is a no-op
81
+ # on older Xcode versions or simulator builds where the file is absent.
82
+ rm -f "${CONFIGURATION_BUILD_DIR}/RaTeX.xcframework-ios.signature"
83
+ SCRIPT
84
+ execution_position: :after_compile
71
85
  }
72
86
  ]
73
87
  end
package/app.plugin.js CHANGED
@@ -1 +1,2 @@
1
- module.exports = require('./lib/module/plugin/withReactNativeEnrichedMarkdown');
1
+ module.exports =
2
+ require('./plugin/build/withReactNativeEnrichedMarkdown').default;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-native-enriched-markdown",
3
- "version": "0.7.1",
3
+ "version": "0.7.3",
4
4
  "description": "Markdown Text component for React Native",
5
5
  "main": "./lib/module/index",
6
6
  "module": "./lib/module/index",
@@ -25,6 +25,7 @@
25
25
  "!**/__mocks__",
26
26
  "!**/.*",
27
27
  "app.plugin.js",
28
+ "plugin",
28
29
  "docs"
29
30
  ],
30
31
  "scripts": {
@@ -36,11 +37,12 @@
36
37
  "lint-clang:android:fix": "find android/ \\( -iname \"*.h\" -o -iname \"*.cpp\" \\) | grep -v -e build | xargs npx clang-format -i",
37
38
  "lint-clang": "yarn lint-clang:ios && yarn lint-clang:android",
38
39
  "lint-clang:fix": "yarn lint-clang:ios:fix && yarn lint-clang:android:fix",
39
- "clean": "del-cli android/build lib",
40
+ "clean": "del-cli android/build lib plugin/build",
40
41
  "sync-md4c": "bash ../../scripts/fetch-md4c.sh",
41
42
  "prepack": "bash ../../scripts/prepare-npm-publish.sh prepack",
42
43
  "postpack": "bash ../../scripts/prepare-npm-publish.sh postpack",
43
- "prepare": "bob build"
44
+ "build:plugin": "tsc -p plugin/tsconfig.build.json",
45
+ "prepare": "bob build && yarn build:plugin"
44
46
  },
45
47
  "keywords": [
46
48
  "react-native",
@@ -0,0 +1,19 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.withAndroidMath = void 0;
4
+ const config_plugins_1 = require("@expo/config-plugins");
5
+ const withAndroidMath = (config, { enableMath = true }) => {
6
+ if (enableMath) {
7
+ return config;
8
+ }
9
+ return (0, config_plugins_1.withGradleProperties)(config, (gradleConfig) => {
10
+ gradleConfig.modResults = gradleConfig.modResults.filter((prop) => prop.type !== 'property' || prop.key !== 'enrichedMarkdown.enableMath');
11
+ gradleConfig.modResults.push({
12
+ type: 'property',
13
+ key: 'enrichedMarkdown.enableMath',
14
+ value: 'false',
15
+ });
16
+ return gradleConfig;
17
+ });
18
+ };
19
+ exports.withAndroidMath = withAndroidMath;
@@ -0,0 +1,28 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.withIosMath = void 0;
7
+ const config_plugins_1 = require("@expo/config-plugins");
8
+ const fs_1 = __importDefault(require("fs"));
9
+ const path_1 = __importDefault(require("path"));
10
+ const IOS_MATH_OPTION = "ENV['ENRICHED_MARKDOWN_ENABLE_MATH'] = '0'";
11
+ const withIosMath = (config, { enableMath = true }) => {
12
+ if (enableMath) {
13
+ return config;
14
+ }
15
+ return (0, config_plugins_1.withDangerousMod)(config, [
16
+ 'ios',
17
+ async (modConfig) => {
18
+ const file = path_1.default.join(modConfig.modRequest.platformProjectRoot, 'Podfile');
19
+ const contents = fs_1.default.readFileSync(file, 'utf8');
20
+ const lines = contents.split('\n');
21
+ const filteredLines = lines.filter((line) => !line.includes('ENRICHED_MARKDOWN_ENABLE_MATH'));
22
+ filteredLines.unshift(IOS_MATH_OPTION);
23
+ fs_1.default.writeFileSync(file, filteredLines.join('\n'));
24
+ return modConfig;
25
+ },
26
+ ]);
27
+ };
28
+ exports.withIosMath = withIosMath;
@@ -0,0 +1,11 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const withIosMath_1 = require("./withIosMath");
4
+ const withAndroidMath_1 = require("./withAndroidMath");
5
+ const withEnrichedMarkdown = (config, props) => {
6
+ const enableMath = props?.enableMath !== false;
7
+ config = (0, withAndroidMath_1.withAndroidMath)(config, { enableMath });
8
+ config = (0, withIosMath_1.withIosMath)(config, { enableMath });
9
+ return config;
10
+ };
11
+ exports.default = withEnrichedMarkdown;
@@ -0,0 +1,16 @@
1
+ {
2
+ "compilerOptions": {
3
+ "module": "commonjs",
4
+ "moduleResolution": "node",
5
+ "ignoreDeprecations": "6.0",
6
+ "target": "ES2020",
7
+ "outDir": "./build",
8
+ "rootDir": "./src",
9
+ "esModuleInterop": true,
10
+ "strict": true,
11
+ "skipLibCheck": true,
12
+ "declaration": false,
13
+ "types": ["node"]
14
+ },
15
+ "include": ["./src/**/*.ts"]
16
+ }
@@ -1,20 +0,0 @@
1
- "use strict";
2
-
3
- import { withGradleProperties } from '@expo/config-plugins';
4
- export const withAndroidMath = (config, {
5
- enableMath = true
6
- }) => {
7
- if (enableMath) {
8
- return config;
9
- }
10
- return withGradleProperties(config, gradleConfig => {
11
- gradleConfig.modResults = gradleConfig.modResults.filter(prop => prop.type !== 'property' || prop.key !== 'enrichedMarkdown.enableMath');
12
- gradleConfig.modResults.push({
13
- type: 'property',
14
- key: 'enrichedMarkdown.enableMath',
15
- value: 'false'
16
- });
17
- return gradleConfig;
18
- });
19
- };
20
- //# sourceMappingURL=withAndroidMath.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":["withGradleProperties","withAndroidMath","config","enableMath","gradleConfig","modResults","filter","prop","type","key","push","value"],"sourceRoot":"../../../src","sources":["plugin/withAndroidMath.ts"],"mappings":";;AAAA,SAASA,oBAAoB,QAA2B,sBAAsB;AAE9E,OAAO,MAAMC,eAAuD,GAAGA,CACrEC,MAAM,EACN;EAAEC,UAAU,GAAG;AAAK,CAAC,KAClB;EACH,IAAIA,UAAU,EAAE;IACd,OAAOD,MAAM;EACf;EACA,OAAOF,oBAAoB,CAACE,MAAM,EAAGE,YAAY,IAAK;IACpDA,YAAY,CAACC,UAAU,GAAGD,YAAY,CAACC,UAAU,CAACC,MAAM,CACrDC,IAAI,IACHA,IAAI,CAACC,IAAI,KAAK,UAAU,IAAID,IAAI,CAACE,GAAG,KAAK,6BAC7C,CAAC;IAEDL,YAAY,CAACC,UAAU,CAACK,IAAI,CAAC;MAC3BF,IAAI,EAAE,UAAU;MAChBC,GAAG,EAAE,6BAA6B;MAClCE,KAAK,EAAE;IACT,CAAC,CAAC;IAEF,OAAOP,YAAY;EACrB,CAAC,CAAC;AACJ,CAAC","ignoreList":[]}
@@ -1,23 +0,0 @@
1
- "use strict";
2
-
3
- import { withDangerousMod } from '@expo/config-plugins';
4
- import fs from 'fs';
5
- import path from 'path';
6
- const IOS_MATH_OPTION = "ENV['ENRICHED_MARKDOWN_ENABLE_MATH'] = '0'";
7
- export const withIosMath = (config, {
8
- enableMath = true
9
- }) => {
10
- if (enableMath) {
11
- return config;
12
- }
13
- return withDangerousMod(config, ['ios', async modConfig => {
14
- const file = path.join(modConfig.modRequest.platformProjectRoot, 'Podfile');
15
- const contents = fs.readFileSync(file, 'utf8');
16
- const lines = contents.split('\n');
17
- const filteredLines = lines.filter(line => !line.includes('ENRICHED_MARKDOWN_ENABLE_MATH'));
18
- filteredLines.unshift(IOS_MATH_OPTION);
19
- fs.writeFileSync(file, filteredLines.join('\n'));
20
- return modConfig;
21
- }]);
22
- };
23
- //# sourceMappingURL=withIosMath.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":["withDangerousMod","fs","path","IOS_MATH_OPTION","withIosMath","config","enableMath","modConfig","file","join","modRequest","platformProjectRoot","contents","readFileSync","lines","split","filteredLines","filter","line","includes","unshift","writeFileSync"],"sourceRoot":"../../../src","sources":["plugin/withIosMath.ts"],"mappings":";;AAAA,SAASA,gBAAgB,QAA2B,sBAAsB;AAC1E,OAAOC,EAAE,MAAM,IAAI;AACnB,OAAOC,IAAI,MAAM,MAAM;AAEvB,MAAMC,eAAe,GAAG,4CAA4C;AAEpE,OAAO,MAAMC,WAAmD,GAAGA,CACjEC,MAAM,EACN;EAAEC,UAAU,GAAG;AAAK,CAAC,KAClB;EACH,IAAIA,UAAU,EAAE;IACd,OAAOD,MAAM;EACf;EACA,OAAOL,gBAAgB,CAACK,MAAM,EAAE,CAC9B,KAAK,EACL,MAAOE,SAAS,IAAK;IACnB,MAAMC,IAAI,GAAGN,IAAI,CAACO,IAAI,CACpBF,SAAS,CAACG,UAAU,CAACC,mBAAmB,EACxC,SACF,CAAC;IACD,MAAMC,QAAQ,GAAGX,EAAE,CAACY,YAAY,CAACL,IAAI,EAAE,MAAM,CAAC;IAE9C,MAAMM,KAAK,GAAGF,QAAQ,CAACG,KAAK,CAAC,IAAI,CAAC;IAClC,MAAMC,aAAa,GAAGF,KAAK,CAACG,MAAM,CAC/BC,IAAY,IAAK,CAACA,IAAI,CAACC,QAAQ,CAAC,+BAA+B,CAClE,CAAC;IAEDH,aAAa,CAACI,OAAO,CAACjB,eAAe,CAAC;IAEtCF,EAAE,CAACoB,aAAa,CAACb,IAAI,EAAEQ,aAAa,CAACP,IAAI,CAAC,IAAI,CAAC,CAAC;IAEhD,OAAOF,SAAS;EAClB,CAAC,CACF,CAAC;AACJ,CAAC","ignoreList":[]}
@@ -1,16 +0,0 @@
1
- "use strict";
2
-
3
- import { withIosMath } from "./withIosMath.js";
4
- import { withAndroidMath } from "./withAndroidMath.js";
5
- const withEnrichedMarkdown = (config, props) => {
6
- const enableMath = props?.enableMath !== false;
7
- config = withAndroidMath(config, {
8
- enableMath
9
- });
10
- config = withIosMath(config, {
11
- enableMath
12
- });
13
- return config;
14
- };
15
- export default withEnrichedMarkdown;
16
- //# sourceMappingURL=withReactNativeEnrichedMarkdown.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":["withIosMath","withAndroidMath","withEnrichedMarkdown","config","props","enableMath"],"sourceRoot":"../../../src","sources":["plugin/withReactNativeEnrichedMarkdown.ts"],"mappings":";;AACA,SAASA,WAAW,QAAQ,kBAAe;AAC3C,SAASC,eAAe,QAAQ,sBAAmB;AAEnD,MAAMC,oBAAmE,GAAGA,CAC1EC,MAAM,EACNC,KAAK,KACF;EACH,MAAMC,UAAU,GAAGD,KAAK,EAAEC,UAAU,KAAK,KAAK;EAE9CF,MAAM,GAAGF,eAAe,CAACE,MAAM,EAAE;IAAEE;EAAW,CAAC,CAAC;EAChDF,MAAM,GAAGH,WAAW,CAACG,MAAM,EAAE;IAAEE;EAAW,CAAC,CAAC;EAE5C,OAAOF,MAAM;AACf,CAAC;AAED,eAAeD,oBAAoB","ignoreList":[]}
@@ -1,5 +0,0 @@
1
- import { type ConfigPlugin } from '@expo/config-plugins';
2
- export declare const withAndroidMath: ConfigPlugin<{
3
- enableMath?: boolean;
4
- }>;
5
- //# sourceMappingURL=withAndroidMath.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"withAndroidMath.d.ts","sourceRoot":"","sources":["../../../../src/plugin/withAndroidMath.ts"],"names":[],"mappings":"AAAA,OAAO,EAAwB,KAAK,YAAY,EAAE,MAAM,sBAAsB,CAAC;AAE/E,eAAO,MAAM,eAAe,EAAE,YAAY,CAAC;IAAE,UAAU,CAAC,EAAE,OAAO,CAAA;CAAE,CAqBlE,CAAC"}
@@ -1,5 +0,0 @@
1
- import { type ConfigPlugin } from '@expo/config-plugins';
2
- export declare const withIosMath: ConfigPlugin<{
3
- enableMath?: boolean;
4
- }>;
5
- //# sourceMappingURL=withIosMath.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"withIosMath.d.ts","sourceRoot":"","sources":["../../../../src/plugin/withIosMath.ts"],"names":[],"mappings":"AAAA,OAAO,EAAoB,KAAK,YAAY,EAAE,MAAM,sBAAsB,CAAC;AAM3E,eAAO,MAAM,WAAW,EAAE,YAAY,CAAC;IAAE,UAAU,CAAC,EAAE,OAAO,CAAA;CAAE,CA4B9D,CAAC"}
@@ -1,6 +0,0 @@
1
- import { type ConfigPlugin } from '@expo/config-plugins';
2
- declare const withEnrichedMarkdown: ConfigPlugin<{
3
- enableMath?: boolean;
4
- } | void>;
5
- export default withEnrichedMarkdown;
6
- //# sourceMappingURL=withReactNativeEnrichedMarkdown.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"withReactNativeEnrichedMarkdown.d.ts","sourceRoot":"","sources":["../../../../src/plugin/withReactNativeEnrichedMarkdown.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,YAAY,EAAE,MAAM,sBAAsB,CAAC;AAIzD,QAAA,MAAM,oBAAoB,EAAE,YAAY,CAAC;IAAE,UAAU,CAAC,EAAE,OAAO,CAAA;CAAE,GAAG,IAAI,CAUvE,CAAC;AAEF,eAAe,oBAAoB,CAAC"}
File without changes
File without changes