Skip to content

micro-lot/editor

Folders and files

NameName
Last commit message
Last commit date

Latest commit

edbf0ea Β· Dec 13, 2024

History

47 Commits
Nov 25, 2024
Dec 13, 2024
Nov 27, 2024
Nov 25, 2024
Nov 29, 2024
Dec 4, 2024
Dec 12, 2024
Dec 4, 2024
Dec 4, 2024
Nov 27, 2024
Nov 28, 2024

Repository files navigation

How to run a demo

npm run dev

Folder structure

src/
  some-node/
    commands/
      some-command.ts
      index.ts
    plugins/
      some-plugin.ts
      index.ts
    schemas/
      some-node.ts
      index.ts
    some-folders/
      index.ts
  • model
    • schema
      • mark: ν…μŠ€νŠΈ μŠ€νƒ€μΌλ§ (μΌλΆ€μ—λ§Œ μ μš©ν•˜λŠ” - ꡡ게, κΈ°μšΈμž„, 밑쀄 ...)
      • attrs: λ…Έλ“œμ˜ ꡬ쑰적 속성 (전체 λ…Έλ“œμ— 영ν–₯)
    • plugin
    • command: μž¬μ‚¬μš© κ°€λŠ₯ν•œ 핡심 둜직 (λ…Έλ“œ 생성 λ“±)
  • state
    • transaction
  • view

간이 λ¬Έμ„œ

Core

μ—λ””ν„°μ—μ„œ μ£Όμš”ν•œ κΈ°λŠ₯, κ³΅ν†΅μœΌλ‘œ μ‚¬μš©ν•  수 μžˆλŠ” κΈ°λŠ₯을 λͺ¨μ•„λ‘” 폴더

μš”μ†Œμ˜ 곡톡 μŠ€νƒ€μΌλ§

schemas/layout.ts, definitions/types.ts μ°Έκ³ 

μ •μ˜ν•˜κ³ μž ν•˜λŠ” μŠ€ν‚€λ§ˆμ— 곡톡 μŠ€νƒ€μΌ 속성을 μΆ”κ°€ν•˜κ³ μž ν•˜λŠ” 경우

  1. μŠ€ν‚€λ§ˆ μΈν„°νŽ˜μ΄μŠ€ μ •μ˜ μ‹œ {Style}Attributes μΈν„°νŽ˜μ΄μŠ€ 상속
interface SomeNodeAttributes extends MarginAttributes {
  // ... λ‹€λ₯Έ 속성
}
  1. λ…Έλ“œ μŠ€νŽ™ νƒ€μž… μ •μ˜ μ‹œ {Style}edNodeSpec μΆ”κ°€
type SomeNodeSpec = NodeSpec & MarginedNodeSpec;

// λ˜λŠ”

interface SomeNodeSpec extends NodeSpec, MarginedNodeSpec {
  // ... λ‹€λ₯Έ 속성
}
  1. μŠ€ν‚€λ§ˆμ— μ •μ˜
const nodeSpec: SomeNodeSpec = {
  // ...
  attrs: {
    // ...
    marginTop: { default: 0 },
    marginRight: { default: 0 },
    marginBottom: { default: 0 },
    marginLeft: { default: 0 },
  },
  // 메타데이터에 μ‚¬μš©ν•  μŠ€νƒ€μΌ 속성 λͺ…μ‹œν•΄μ•Όν•¨!
  meta: {
    applicableStyles: {
      margin: true,
    },
  },
  // parseDOM, toDOM 적절히 처리
  parseDOM: [],
  toDOM(node) {},
};

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published