Skip to content

Commit

Permalink
Merge branch 'main' into @tomekzaw/github-actions-paper-fabric
Browse files Browse the repository at this point in the history
  • Loading branch information
tomekzaw committed Apr 12, 2024
2 parents 8680ae9 + 4919dac commit 4d8611d
Show file tree
Hide file tree
Showing 10 changed files with 25 additions and 69 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/build-ios.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ jobs:
example/ios/Pods
~/Library/Caches/CocoaPods
~/.cocoapods
key: build-ios-pods-${{ hashFiles('example/ios/Podfile.lock') }}
key: build-ios-pods-${{ hashFiles('example/node_modules/react-native/package.json') }}
restore-keys: build-ios-pods-

- name: Install Pods
Expand All @@ -69,7 +69,7 @@ jobs:
uses: actions/cache@v4
with:
path: ~/Library/Developer/Xcode/DerivedData
key: build-ios-derived-data-${{ hashFiles('example/ios/Podfile.lock') }}
key: build-ios-derived-data-${{ hashFiles('example/node_modules/react-native/package.json') }}
restore-keys: build-ios-derived-data-

- name: Build app
Expand Down
1 change: 0 additions & 1 deletion .yarnrc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ nmHoistingLimits: workspaces
nodeLinker: node-modules

plugins:
- path: scripts/pod-install.cjs
- path: .yarn/plugins/@yarnpkg/plugin-interactive-tools.cjs
spec: "@yarnpkg/plugin-interactive-tools"
- path: .yarn/plugins/@yarnpkg/plugin-workspace-tools.cjs
Expand Down
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ By default, the example is configured to build with the old architecture. To run
2. For iOS, run:

```sh
RCT_NEW_ARCH_ENABLED=1 yarn pod-install example/ios
cd example/ios && bundler install && RCT_NEW_ARCH_ENABLED=1 bundler exec pod install
yarn example ios
```

Expand Down
14 changes: 12 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,11 @@ It is also possible to customize the styling of the formatted contents of `Markd
```tsx
import type {MarkdownStyle} from '@expensify/react-native-live-markdown';

const FONT_FAMILY_MONOSPACE = Platform.select({
ios: 'Courier',
default: 'monospace',
});

const markdownStyle: MarkdownStyle = {
syntax: {
color: 'gray',
Expand All @@ -67,19 +72,24 @@ const markdownStyle: MarkdownStyle = {
h1: {
fontSize: 25,
},
emoji: {
fontSize: 20,
},
blockquote: {
borderColor: 'gray',
borderWidth: 6,
marginLeft: 6,
paddingLeft: 6,
},
code: {
fontFamily: 'monospace',
fontFamily: FONT_FAMILY_MONOSPACE,
fontSize: 20,
color: 'black',
backgroundColor: 'lightgray',
},
pre: {
fontFamily: 'monospace',
fontFamily: FONT_FAMILY_MONOSPACE,
fontSize: 20,
color: 'black',
backgroundColor: 'lightgray',
},
Expand Down
8 changes: 4 additions & 4 deletions example/ios/Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1111,12 +1111,12 @@ PODS:
- React-jsi (= 0.73.4)
- React-logger (= 0.73.4)
- React-perflogger (= 0.73.4)
- RNLiveMarkdown (0.1.52):
- RNLiveMarkdown (0.1.54):
- glog
- RCT-Folly (= 2022.05.16.00)
- React-Core
- RNLiveMarkdown/common (= 0.1.52)
- RNLiveMarkdown/common (0.1.52):
- RNLiveMarkdown/common (= 0.1.54)
- RNLiveMarkdown/common (0.1.54):
- glog
- RCT-Folly (= 2022.05.16.00)
- React-Core
Expand Down Expand Up @@ -1376,7 +1376,7 @@ SPEC CHECKSUMS:
React-runtimescheduler: ed48e5faac6751e66ee1261c4bd01643b436f112
React-utils: 6e5ad394416482ae21831050928ae27348f83487
ReactCommon: 840a955d37b7f3358554d819446bffcf624b2522
RNLiveMarkdown: 35d7377d07dcf3e0ecfb1b202550f31829e1ae42
RNLiveMarkdown: 2f6f838a2089bd7337020a82800cb0c05c48c5d9
SocketRocket: f32cd54efbe0f095c4d7594881e52619cfe80b17
Yoga: 64cd2a583ead952b0315d5135bf39e053ae9be70

Expand Down
3 changes: 1 addition & 2 deletions example/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,7 @@
"@babel/runtime": "^7.20.0",
"@react-native/babel-preset": "0.73.21",
"@react-native/metro-config": "0.73.5",
"babel-plugin-module-resolver": "^5.0.0",
"pod-install": "^0.1.0"
"babel-plugin-module-resolver": "^5.0.0"
},
"engines": {
"node": ">=18"
Expand Down
4 changes: 1 addition & 3 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@expensify/react-native-live-markdown",
"version": "0.1.54",
"version": "0.1.58",
"description": "Drop-in replacement for React Native's TextInput component with Markdown formatting.",
"main": "lib/commonjs/index",
"module": "lib/module/index",
Expand Down Expand Up @@ -69,7 +69,6 @@
"@types/jest": "^28.1.2",
"@types/react": "~17.0.21",
"@types/react-native": "0.70.0",
"@types/underscore": "^1.11.15",
"@typescript-eslint/eslint-plugin": "^6.15.0",
"@typescript-eslint/parser": "^6.15.0",
"del-cli": "^5.0.0",
Expand All @@ -88,7 +87,6 @@
"eslint-plugin-tsdoc": "^0.2.17",
"jest": "^29.6.3",
"jest-environment-jsdom": "^29.7.0",
"pod-install": "^0.1.0",
"prettier": "2.8.8",
"react": "18.2.0",
"react-native": "0.73.4",
Expand Down
40 changes: 0 additions & 40 deletions scripts/pod-install.cjs

This file was deleted.

6 changes: 4 additions & 2 deletions src/web/InputHistory.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ export default class InputHistory {

debounceTime: number;

constructor(depth: number, debounceTime = 200) {
constructor(depth: number, debounceTime = 150) {
this.depth = depth;
this.history = [];
this.historyIndex = 0;
Expand Down Expand Up @@ -61,6 +61,7 @@ export default class InputHistory {
if (this.history.length > 0) {
const lastItem = this.history[this.history.length - 1];
if (lastItem && text === lastItem.text) {
this.historyIndex = this.history.length - 1;
return;
}
}
Expand All @@ -80,7 +81,8 @@ export default class InputHistory {
undo(): HistoryItem | null {
if (this.currentText !== null && this.timeout) {
clearTimeout(this.timeout);
return this.history[this.history.length - 1] || null;
this.timeout = null;
return this.history[this.historyIndex] || null;
}

if (this.history.length === 0 || this.historyIndex - 1 < 0) {
Expand Down
12 changes: 0 additions & 12 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2375,7 +2375,6 @@ __metadata:
"@react-native/metro-config": 0.73.5
babel-plugin-module-resolver: ^5.0.0
patch-package: ^8.0.0
pod-install: ^0.1.0
postinstall-postinstall: ^2.1.0
react: 18.2.0
react-native: 0.73.4
Expand Down Expand Up @@ -2411,7 +2410,6 @@ __metadata:
"@types/jest": ^28.1.2
"@types/react": ~17.0.21
"@types/react-native": 0.70.0
"@types/underscore": ^1.11.15
"@typescript-eslint/eslint-plugin": ^6.15.0
"@typescript-eslint/parser": ^6.15.0
del-cli: ^5.0.0
Expand All @@ -2430,7 +2428,6 @@ __metadata:
eslint-plugin-tsdoc: ^0.2.17
jest: ^29.6.3
jest-environment-jsdom: ^29.7.0
pod-install: ^0.1.0
prettier: 2.8.8
react: 18.2.0
react-native: 0.73.4
Expand Down Expand Up @@ -15831,15 +15828,6 @@ __metadata:
languageName: node
linkType: hard

"pod-install@npm:^0.1.0":
version: 0.1.39
resolution: "pod-install@npm:0.1.39"
bin:
pod-install: build/index.js
checksum: 200302341847251d4db25f950d15367f6f45f5358d87b18bf01054094f02b2572d007f73c8020b1565dd3e6b23f861965f9bad434873d3c8e834be0e7124fa3e
languageName: node
linkType: hard

"possible-typed-array-names@npm:^1.0.0":
version: 1.0.0
resolution: "possible-typed-array-names@npm:1.0.0"
Expand Down

0 comments on commit 4d8611d

Please sign in to comment.