Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions .github/CODE_OF_CONDUCT.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# Code of Conduct

**What is a Code of Conduct?**
A code of conduct is a set of guidelines and expectations for behavior within a community. It helps create a positive and inclusive environment for all members of the community, and it sets clear standards for how members should interact with each other. A code of conduct can help prevent harassment, discrimination, and other forms of harmful behavior, and it can also provide a framework for addressing any issues that may arise.

## Our Code of Conduct
We are committed to creating a welcoming and inclusive environment for all members of our community. We expect all members to adhere to the following code of conduct:

**1. Be respectful:** Treat all members of the community with respect and kindness. Avoid using language or behavior that is offensive, discriminatory, or harassing. Some might be less experienced than others, so be patient and understanding.

**2. Be inclusive:** We welcome and encourage participation from people of all backgrounds, identities, and experiences. Avoid making assumptions about others based on their race, gender, sexual orientation, religion, or any other characteristic. We also ask that you use inclusive language and avoid making jokes or comments that could be hurtful to others.

**3. Be professional:** We expect all members of the community to conduct themselves in a professional manner. Avoid engaging in behavior that is disruptive, disrespectful, or unprofessional. This includes but is not limited to trolling, flaming, and spamming.

**4. Be collaborative:** We encourage collaboration and teamwork within our community. Avoid engaging in behavior that is divisive or that undermines the efforts of others. This includes but is not limited to creating duplicate issues or pull requests, or engaging in arguments or conflicts with other members.

**5. Report issues:** If you witness or experience any behavior that violates this code of conduct, please report it to the a maintainer or the authors of the library. We take all reports seriously and will take appropriate action to address any issues that arise.

## Conclusion
We may update this code of conduct from time to time, and we encourage all members of our community to review it regularly. By adhering to this code of conduct, we can create a positive and inclusive environment for everyone in our community.
86 changes: 86 additions & 0 deletions .github/ISSUE_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
## Issue type

<!-- Pick one and delete the others: -->
- [ ] Bug report
- [ ] New component request
- [ ] Feature request / improvement
- [ ] Other

---

<!-- ============================================================
BUG REPORT — keep this section if you picked "Bug report"
============================================================ -->

## Component affected

<!-- e.g. NativeButton, NativeTabBar -->

## What happened?

## What did you expect?

## Steps to reproduce

1.
2.
3.

## Environment

- **liquid-react version:**
- **React Native version:**
- **iOS version:**
- **Device / Simulator:**

---

<!-- ============================================================
NEW COMPONENT — keep this section if you picked "New component request"
============================================================ -->

## UIKit class name

<!-- The exact UIKit class, e.g. UIColorWell -->

## Suggested name in liquid-react

<!-- e.g. NativeColorWell -->

## Why do you need it?

## Props / API you'd expect

<!--
- value: string
- onChange: (e) => void
-->

## Minimum iOS version

- [ ] This is part of Apple's **public** UIKit API (no private frameworks)

---

<!-- ============================================================
FEATURE REQUEST — keep this section if you picked "Feature request"
============================================================ -->

## What do you want to improve?

## What's the problem right now?

## What would you like instead?

- [ ] I believe this is doable with Apple's public APIs

---

## Anything else?

<!-- Logs, screenshots, Apple docs links, anything that helps. -->

<!-- ============================================================
OTHER — keep this section if you picked "Other"
Describe your issue in detail and provide any relevant context.
============================================================ -->
29 changes: 29 additions & 0 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
## What does this PR do?

<!-- A short description of what you changed and why. -->

## Type of change

- [ ] Bug fix
- [ ] New component
- [ ] Refactor / cleanup
- [ ] Docs update
- [ ] Other (describe above)

## Related issue

Closes #<!-- issue number, if applicable -->

## Notes for reviewers

<!-- Anything specific you want us to look at, known limitations, or context that isn't obvious from the code. -->

---

## Checklist

- [ ] Follows Code of Conduct and contributing guidelines
- [ ] If code changes were made, they were tested and verified to work
- [ ] I've updated the documentation to reflect said changes (if applicable)
- [ ] This is *not* a code change (e.g. a documentation update)
- [ ] Code passes CI/CD checks (if PR is ready for review, otherwise mark as draft)
1 change: 1 addition & 0 deletions .github/workflows/lint-and-build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@

55 changes: 55 additions & 0 deletions .github/workflows/native-build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
name: Full Build Check

on:
workflow_dispatch:

jobs:
build:
name: TypeScript + Native Compilation
runs-on: macos-latest

steps:
- name: Checkout
uses: actions/checkout@v4

- name: Setup Node 20
uses: actions/setup-node@v4
with:
node-version: 20
cache: npm

- name: Install JS dependencies
run: npm ci --legacy-peer-deps

- name: ESLint
run: npm run lint

- name: Prettier check
run: npm run format:check

- name: TypeScript type-check
run: npm run typecheck

- name: TypeScript build
run: npm run build

- name: Install SwiftLint
run: brew install swiftlint

- name: SwiftLint
run: swiftlint lint --config .swiftlint.yml

- name: Install CocoaPods
run: |
cd ios
pod install --repo-update || echo "No Podfile found, skipping pod install"

- name: Build with xcodebuild
run: |
xcodebuild \
-workspace ios/*.xcworkspace \
-scheme LiquidReact \
-sdk iphonesimulator \
-destination 'platform=iOS Simulator,name=iPhone 16' \
build \
CODE_SIGNING_ALLOWED=NO | xcpretty || true
42 changes: 42 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: Publish to npm

on:
push:
tags:
- 'v*.*.*'

jobs:
publish:
name: Publish Package
runs-on: ubuntu-latest

permissions:
contents: read

steps:
- name: Checkout
uses: actions/checkout@v4

- name: Setup Node 20
uses: actions/setup-node@v4
with:
node-version: 20
cache: npm
registry-url: https://registry.npmjs.org

- name: Install dependencies
run: npm ci --legacy-peer-deps

- name: Lint
run: npm run lint

- name: Type-check
run: npm run typecheck

- name: Build
run: npm run build

- name: Publish
run: npm publish --access public
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
24 changes: 24 additions & 0 deletions .github/workflows/swift-lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name: SwiftLint

on:
push:
branches: [main, staging, forProduction]
paths:
- 'ios/**'
pull_request:
paths:
- 'ios/**'

jobs:
swiftlint:
name: Swift Lint
runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v4

- name: Run SwiftLint
uses: norio-nomura/action-swiftlint@3.2.1
with:
args: --config .swiftlint.yml
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,5 @@ logs/
# Ignore IDE specific files
.idea/
.vscode/
.venv
package-lock.json
4 changes: 2 additions & 2 deletions index.js
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
// Export everything from src/index.ts
export * from './src/index';
// Re-export compiled library output
module.exports = require('./lib/index');
2 changes: 0 additions & 2 deletions ios/LRNativeMaterialViewManager.swift
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,6 @@ class NativeMaterialView: UIView {
updateMaterial()
}
}
// ...existing code...

@objc var onPress: RCTBubblingEventBlock?

override init(frame: CGRect) {
Expand Down
2 changes: 2 additions & 0 deletions ios/LRNativeToolbarButtonManager.swift
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,8 @@ class NativeToolbarButtonContainer: UIView {
case "edit": type = .edit
case "save": type = .save
case "add": type = .add
case "flexibleSpace": type = .flexibleSpace
case "fixedSpace": type = .fixedSpace
case "compose": type = .compose
case "reply": type = .reply
case "action": type = .action
Expand Down
5 changes: 2 additions & 3 deletions ios/LRNativeToolbarMenuManager.swift
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,6 @@ class NativeToolbarMenuContainer: UIView {
override init(frame: CGRect) {
super.init(frame: frame)
setupButton()
// Keep the view in the hierarchy (not hidden) so RCTDirectEventBlock
// can dispatch events to JS. Make it invisible instead.
self.frame = CGRect(x: 0, y: 0, width: 1, height: 1)
self.clipsToBounds = true
self.alpha = 0
Expand Down Expand Up @@ -78,7 +76,8 @@ class NativeToolbarMenuContainer: UIView {
}

private func updateMenu() {
let menuElements = buildMenuElements(from: menuItems as! [[String: Any]])
guard let items = menuItems as? [[String: Any]] else { return }
let menuElements = buildMenuElements(from: items)
let menu = UIMenu(children: menuElements)
barButtonItem.menu = menu
}
Expand Down
2 changes: 1 addition & 1 deletion liquid-react.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ Pod::Spec.new do |s|
s.homepage = package['repository']['url']
s.license = package['license']
s.author = package['author']
s.platform = :ios, "13.0"
s.platform = :ios, "15.0"
s.source = { :git => package['repository']['url'], :tag => "v#{s.version}" }
s.source_files = "ios/**/*.{h,m,swift}"
s.requires_arc = true
Expand Down
10 changes: 6 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,11 @@
"name": "liquid-react",
"version": "1.0.0",
"description": "Production-ready React Native iOS module exposing Apple's native UIKit Liquid Glass components",
"main": "index.js",
"types": "dist/index.d.ts",
"main": "lib/index.js",
"types": "lib/index.d.ts",
"scripts": {
"build": "tsc",
"prepublishOnly": "npm run build",
"test": "echo \"Error: no test specified\" && exit 1",
"lint": "eslint . --ext .js,.jsx,.ts,.tsx"
},
Expand All @@ -28,11 +30,11 @@
"react-native": ">=0.65.0"
},
"devDependencies": {
"@types/react": "^18.0.0",
"@types/react-native": "^0.73.0",
"@types/react": "^19.0.0",
"typescript": "^5.0.0"
},
"files": [
"lib/",
"src/",
"ios/",
"liquid-react.podspec",
Expand Down
1 change: 1 addition & 0 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ export type {
SearchBarChangeEvent,
TabBarPressEvent,
ToolbarMenuActionEvent,
ToolbarButtonPressEvent,
NativeMaterialViewProps,
NativeButtonProps,
NativeSwitchProps,
Expand Down
Loading