{"size": 1208, "ext": "js", "max_stars_repo_path": "src/summaries/embed/QuoteBlot.js", "max_stars_repo_name": "CustomerDB/app.customerdb.com", "max_stars_repo_stars_event_min_datetime": "2021-04-03T05:38:10.000Z", "max_stars_repo_stars_event_max_datetime": "2022-02-18T08:29:02.000Z", "max_issues_repo_path": "src/summaries/embed/QuoteBlot.js", "max_issues_repo_name": "CustomerDB/app.customerdb.com", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "src/summaries/embed/QuoteBlot.js", "max_forks_repo_name": "CustomerDB/app.customerdb.com", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": 5, "max_issues_count": null, "max_forks_count": null, "avg_line_length": 30.2, "max_line_length": 75, "alphanum_fraction": 0.7094370861}
// Copyright 2021 Quantap Inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
//     http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

import Quill from "quill";

const Embed = Quill.import("blots/embed");

export default class QuoteBlot extends Embed {
  static blotName = "direct-quote";
  static className = "direct-quote";
  static tagName = "div";
  static onClick = () => {
    console.log("clicked quote");
  };

  static create(value) {
    let node = super.create();
    node.classList.add(QuoteBlot.className);
    node.dataset.highlightID = value;
    node.setAttribute("contenteditable", "false");
    node.addEventListener("click", QuoteBlot.onClick);
    return node;
  }

  static value(node) {
    return node.dataset.highlightID;
  }
}
