1.8.7-develop.0 • Published 5 months ago

companycam-tiptap-editor v1.8.7-develop.0

Weekly downloads
-
License
ISC
Repository
github
Last release
5 months ago

CompanyCam TipTap Editor

This is a new CompanyCam rich-text document editor application built with TipTap, written in ReactJS and Typescript.

Setup

  • Clone this repository to destination folder: git clone https://github.com/CompanyCam/companycam-tiptap-editor
  • Run yarn

UI And Styling

This ReactJS app uses SCSS for custom styling for both the custom TipTap editor and the local development app for testing. The main styling can be found in the file tiptap-editor/src/styles/styles.scss

Styling the TipTap Editor

Tiptap is headless, that means there is no styling provided. That also means, you are in full control of how your editor looks. The following methods allow you to apply custom styles to the editor. Styling Guide

ProseMirror CSS

TipTap comes pre-loaded with the default styles from the ProseMirror SDK. You can override these styles in the styles.scss file.

Running Playground

To run the app to in playground mode to test the editor while in development just run

yarn start

Building

Usage in the CompanyCam Mobile Application

Testing

To test the tiptap editor in the companycam-mobile app run yarn start:mobile

Then point the webview to the local development server at http://localhost:8080. See the file TipTapEditor.jsx in https://github.com/CompanyCam/companycam-mobile.

Building

  • Run yarn run build:mobile.
  • Copy the entire contents of the ./mobile-app/dist folder to the CompanyCam mobile repo.
    • Path: cocam-tiptap-editor/mobile-app/dist/* -> companycam-mobile/ios/CompanyCam/TipTap.bundle/.
  • Yes. Overwrite all the files in the TipTap.bundle.

:memo: For all intents and purposes TipTap.bundle is a folder, with a file extension. To open the bundle, you can go one of two routes:

  • In a terminal, navigate to the root of the companycam-mobile repo, and type open ios/CompanyCam/TipTap.bundle/..
  • In Finder, navigate to the companycam-mobile/ios/CompanyCam/ folder, right-click on TipTap.bundle, and click Show Contents.

iOS

After you've copied the contents of the build folder to companycam-mobile/ios/CompanyCam/TipTap.bundle you will need to rebuild the application by running yarn run ios. If you just hot-reload, the application will not see the change to the contents of the bundle as they are loaded at startup.

Android

Assets are copied from companycam-mobile/ios/CompanyCam/TipTap.bundle to companycam-mobile/android/app/src/main/assets/tiptap when the app is compiled.

Same as iOS: You will need to rebuild every time assets are copied into the bundle by running yarn run android.

Usage in the Web App

TBD

Development

List of TODOs:

1.8.7-develop.0

5 months ago